Skip to content

Commit 47e5d1b

Browse files
Jiri Bencdavem330
authored andcommitted
vxlan: move fdb code to common location in vxlan_xmit
Handle VXLAN_F_COLLECT_METADATA before VXLAN_F_PROXY. The latter does not make sense with the former, as it needs populated fdb which does not happen in metadata mode. After this cleanup, the fdb code in vxlan_xmit is moved to a common location and can be later skipped for VXLAN-GPE which does not necessarily carry inner Ethernet header. v2: changed commit description to not reference L3 mode Signed-off-by: Jiri Benc <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 0c867c9 commit 47e5d1b

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

drivers/net/vxlan.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2106,9 +2106,17 @@ static netdev_tx_t vxlan_xmit(struct sk_buff *skb, struct net_device *dev)
21062106
info = skb_tunnel_info(skb);
21072107

21082108
skb_reset_mac_header(skb);
2109-
eth = eth_hdr(skb);
21102109

2111-
if ((vxlan->flags & VXLAN_F_PROXY)) {
2110+
if (vxlan->flags & VXLAN_F_COLLECT_METADATA) {
2111+
if (info && info->mode & IP_TUNNEL_INFO_TX)
2112+
vxlan_xmit_one(skb, dev, NULL, false);
2113+
else
2114+
kfree_skb(skb);
2115+
return NETDEV_TX_OK;
2116+
}
2117+
2118+
if (vxlan->flags & VXLAN_F_PROXY) {
2119+
eth = eth_hdr(skb);
21122120
if (ntohs(eth->h_proto) == ETH_P_ARP)
21132121
return arp_reduce(dev, skb);
21142122
#if IS_ENABLED(CONFIG_IPV6)
@@ -2123,18 +2131,10 @@ static netdev_tx_t vxlan_xmit(struct sk_buff *skb, struct net_device *dev)
21232131
msg->icmph.icmp6_type == NDISC_NEIGHBOUR_SOLICITATION)
21242132
return neigh_reduce(dev, skb);
21252133
}
2126-
eth = eth_hdr(skb);
21272134
#endif
21282135
}
21292136

2130-
if (vxlan->flags & VXLAN_F_COLLECT_METADATA) {
2131-
if (info && info->mode & IP_TUNNEL_INFO_TX)
2132-
vxlan_xmit_one(skb, dev, NULL, false);
2133-
else
2134-
kfree_skb(skb);
2135-
return NETDEV_TX_OK;
2136-
}
2137-
2137+
eth = eth_hdr(skb);
21382138
f = vxlan_find_mac(vxlan, eth->h_dest);
21392139
did_rsc = false;
21402140

0 commit comments

Comments
 (0)