vxlan: do not use fdb in metadata mode
authorJiri Benc <jbenc@redhat.com>
Tue, 16 Feb 2016 21:18:26 +0000 (22:18 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 18 Feb 2016 20:01:14 +0000 (15:01 -0500)
In metadata mode, the vxlan interface is not supposed to use the fdb control
plane but an external one (openvswitch or static routes). With the current
code, packets may leak into the fdb handling code which usually causes them
to be dropped anyway but may have strange side effects.

Just drop the packets directly when in metadata mode if the destination data
are not correctly provided on egress.

Signed-off-by: Jiri Benc <jbenc@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/vxlan.c

index db96f3a16f6c3e53d4c284a80e1bd658b3a7e301..e6944b29588e1bd329c5b331988373d5297c0bd6 100644 (file)
@@ -2171,9 +2171,11 @@ static netdev_tx_t vxlan_xmit(struct sk_buff *skb, struct net_device *dev)
 #endif
        }
 
-       if (vxlan->flags & VXLAN_F_COLLECT_METADATA &&
-           info && info->mode & IP_TUNNEL_INFO_TX) {
-               vxlan_xmit_one(skb, dev, NULL, false);
+       if (vxlan->flags & VXLAN_F_COLLECT_METADATA) {
+               if (info && info->mode & IP_TUNNEL_INFO_TX)
+                       vxlan_xmit_one(skb, dev, NULL, false);
+               else
+                       kfree_skb(skb);
                return NETDEV_TX_OK;
        }
 
This page took 0.025587 seconds and 5 git commands to generate.