Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 377373
b: refs/heads/master
c: 26a41ae
h: refs/heads/master
i:
  377371: bc3bea4
v: v3
  • Loading branch information
stephen hemminger authored and David S. Miller committed Jun 17, 2013
1 parent cef4863 commit fb67212
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3bf74b1aecdce719f1445200d5db7dfee2297bba
refs/heads/master: 26a41ae604381c5cc0caf1c3261ca6b298b5fe69
16 changes: 12 additions & 4 deletions trunk/drivers/net/vxlan.c
Original file line number Diff line number Diff line change
Expand Up @@ -565,8 +565,9 @@ static int vxlan_fdb_dump(struct sk_buff *skb, struct netlink_callback *cb,

/* Watch incoming packets to learn mapping between Ethernet address
* and Tunnel endpoint.
* Return true if packet is bogus and should be droppped.
*/
static void vxlan_snoop(struct net_device *dev,
static bool vxlan_snoop(struct net_device *dev,
__be32 src_ip, const u8 *src_mac)
{
struct vxlan_dev *vxlan = netdev_priv(dev);
Expand All @@ -575,7 +576,11 @@ static void vxlan_snoop(struct net_device *dev,
f = vxlan_find_mac(vxlan, src_mac);
if (likely(f)) {
if (likely(f->remote.remote_ip == src_ip))
return;
return false;

/* Don't migrate static entries, drop packets */
if (!(f->flags & NTF_SELF))
return true;

if (net_ratelimit())
netdev_info(dev,
Expand All @@ -598,6 +603,8 @@ static void vxlan_snoop(struct net_device *dev,
0, NTF_SELF);
spin_unlock(&vxlan->hash_lock);
}

return false;
}


Expand Down Expand Up @@ -729,8 +736,9 @@ static int vxlan_udp_encap_recv(struct sock *sk, struct sk_buff *skb)
vxlan->dev->dev_addr) == 0)
goto drop;

if (vxlan->flags & VXLAN_F_LEARN)
vxlan_snoop(skb->dev, oip->saddr, eth_hdr(skb)->h_source);
if ((vxlan->flags & VXLAN_F_LEARN) &&
vxlan_snoop(skb->dev, oip->saddr, eth_hdr(skb)->h_source))
goto drop;

__skb_tunnel_rx(skb, vxlan->dev);
skb_reset_network_header(skb);
Expand Down

0 comments on commit fb67212

Please sign in to comment.