Commit 7d6556ac authored by David S. Miller's avatar David S. Miller

Merge branch 'vxlan-fdb-fixes'

Roopa Prabhu says:

====================
vxlan: misc fdb fixes
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents a824d0b8 efb5f68f
...@@ -2268,7 +2268,7 @@ static void vxlan_cleanup(unsigned long arg) ...@@ -2268,7 +2268,7 @@ static void vxlan_cleanup(unsigned long arg)
= container_of(p, struct vxlan_fdb, hlist); = container_of(p, struct vxlan_fdb, hlist);
unsigned long timeout; unsigned long timeout;
if (f->state & NUD_PERMANENT) if (f->state & (NUD_PERMANENT | NUD_NOARP))
continue; continue;
timeout = f->used + vxlan->cfg.age_interval * HZ; timeout = f->used + vxlan->cfg.age_interval * HZ;
...@@ -2354,7 +2354,7 @@ static int vxlan_open(struct net_device *dev) ...@@ -2354,7 +2354,7 @@ static int vxlan_open(struct net_device *dev)
} }
/* Purge the forwarding table */ /* Purge the forwarding table */
static void vxlan_flush(struct vxlan_dev *vxlan) static void vxlan_flush(struct vxlan_dev *vxlan, bool do_all)
{ {
unsigned int h; unsigned int h;
...@@ -2364,6 +2364,8 @@ static void vxlan_flush(struct vxlan_dev *vxlan) ...@@ -2364,6 +2364,8 @@ static void vxlan_flush(struct vxlan_dev *vxlan)
hlist_for_each_safe(p, n, &vxlan->fdb_head[h]) { hlist_for_each_safe(p, n, &vxlan->fdb_head[h]) {
struct vxlan_fdb *f struct vxlan_fdb *f
= container_of(p, struct vxlan_fdb, hlist); = container_of(p, struct vxlan_fdb, hlist);
if (!do_all && (f->state & (NUD_PERMANENT | NUD_NOARP)))
continue;
/* the all_zeros_mac entry is deleted at vxlan_uninit */ /* the all_zeros_mac entry is deleted at vxlan_uninit */
if (!is_zero_ether_addr(f->eth_addr)) if (!is_zero_ether_addr(f->eth_addr))
vxlan_fdb_destroy(vxlan, f); vxlan_fdb_destroy(vxlan, f);
...@@ -2385,7 +2387,7 @@ static int vxlan_stop(struct net_device *dev) ...@@ -2385,7 +2387,7 @@ static int vxlan_stop(struct net_device *dev)
del_timer_sync(&vxlan->age_timer); del_timer_sync(&vxlan->age_timer);
vxlan_flush(vxlan); vxlan_flush(vxlan, false);
vxlan_sock_release(vxlan); vxlan_sock_release(vxlan);
return ret; return ret;
...@@ -3058,6 +3060,8 @@ static void vxlan_dellink(struct net_device *dev, struct list_head *head) ...@@ -3058,6 +3060,8 @@ static void vxlan_dellink(struct net_device *dev, struct list_head *head)
struct vxlan_dev *vxlan = netdev_priv(dev); struct vxlan_dev *vxlan = netdev_priv(dev);
struct vxlan_net *vn = net_generic(vxlan->net, vxlan_net_id); struct vxlan_net *vn = net_generic(vxlan->net, vxlan_net_id);
vxlan_flush(vxlan, true);
spin_lock(&vn->sock_lock); spin_lock(&vn->sock_lock);
if (!hlist_unhashed(&vxlan->hlist)) if (!hlist_unhashed(&vxlan->hlist))
hlist_del_rcu(&vxlan->hlist); hlist_del_rcu(&vxlan->hlist);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment