vxlan: don't bypass encapsulation for multi- and broadcasts
authorMike Rapoport <[email protected]>
Sat, 13 Apr 2013 23:21:51 +0000 (23:21 +0000)
committerDavid S. Miller <[email protected]>
Mon, 15 Apr 2013 18:06:39 +0000 (14:06 -0400)
The multicast and broadcast packets may have RTCF_LOCAL set in rt_flags
and therefore will be sent out bypassing encapsulation. This breaks
delivery of packets sent to the vxlan multicast group.
Disabling encapsulation bypass for multicasts and broadcasts fixes the
issue.

Signed-off-by: Mike Rapoport <[email protected]>
Tested-by: Cong Wang <[email protected]>
Acked-by: Sridhar Samudrala <[email protected]>
Tested-by: Sridhar Samudrala <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
drivers/net/vxlan.c

index 725aba37e182b39c1d35b82c8d424210a8e0f05c..97a306c9e65d6faa5a213c58a2748f847e70a23a 100644 (file)
@@ -1014,7 +1014,8 @@ static netdev_tx_t vxlan_xmit_one(struct sk_buff *skb, struct net_device *dev,
        }
 
        /* Bypass encapsulation if the destination is local */
-       if (rt->rt_flags & RTCF_LOCAL) {
+       if (rt->rt_flags & RTCF_LOCAL &&
+           !(rt->rt_flags & (RTCF_BROADCAST | RTCF_MULTICAST))) {
                struct vxlan_dev *dst_vxlan;
 
                ip_rt_put(rt);