|
@@ -59,6 +59,8 @@ static const u8 all_zeros_mac[ETH_ALEN + 2];
|
|
|
|
|
|
static int vxlan_sock_add(struct vxlan_dev *vxlan);
|
|
static int vxlan_sock_add(struct vxlan_dev *vxlan);
|
|
|
|
|
|
|
|
+static void vxlan_vs_del_dev(struct vxlan_dev *vxlan);
|
|
|
|
+
|
|
/* per-network namespace private data for this module */
|
|
/* per-network namespace private data for this module */
|
|
struct vxlan_net {
|
|
struct vxlan_net {
|
|
struct list_head vxlan_list;
|
|
struct list_head vxlan_list;
|
|
@@ -1081,6 +1083,8 @@ static void vxlan_sock_release(struct vxlan_dev *vxlan)
|
|
rcu_assign_pointer(vxlan->vn4_sock, NULL);
|
|
rcu_assign_pointer(vxlan->vn4_sock, NULL);
|
|
synchronize_net();
|
|
synchronize_net();
|
|
|
|
|
|
|
|
+ vxlan_vs_del_dev(vxlan);
|
|
|
|
+
|
|
if (__vxlan_sock_release_prep(sock4)) {
|
|
if (__vxlan_sock_release_prep(sock4)) {
|
|
udp_tunnel_sock_release(sock4->sock);
|
|
udp_tunnel_sock_release(sock4->sock);
|
|
kfree(sock4);
|
|
kfree(sock4);
|
|
@@ -2356,6 +2360,15 @@ static void vxlan_cleanup(unsigned long arg)
|
|
mod_timer(&vxlan->age_timer, next_timer);
|
|
mod_timer(&vxlan->age_timer, next_timer);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+static void vxlan_vs_del_dev(struct vxlan_dev *vxlan)
|
|
|
|
+{
|
|
|
|
+ struct vxlan_net *vn = net_generic(vxlan->net, vxlan_net_id);
|
|
|
|
+
|
|
|
|
+ spin_lock(&vn->sock_lock);
|
|
|
|
+ hlist_del_init_rcu(&vxlan->hlist);
|
|
|
|
+ spin_unlock(&vn->sock_lock);
|
|
|
|
+}
|
|
|
|
+
|
|
static void vxlan_vs_add_dev(struct vxlan_sock *vs, struct vxlan_dev *vxlan)
|
|
static void vxlan_vs_add_dev(struct vxlan_sock *vs, struct vxlan_dev *vxlan)
|
|
{
|
|
{
|
|
struct vxlan_net *vn = net_generic(vxlan->net, vxlan_net_id);
|
|
struct vxlan_net *vn = net_generic(vxlan->net, vxlan_net_id);
|
|
@@ -3300,15 +3313,9 @@ static int vxlan_changelink(struct net_device *dev, struct nlattr *tb[],
|
|
static void vxlan_dellink(struct net_device *dev, struct list_head *head)
|
|
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);
|
|
|
|
|
|
|
|
vxlan_flush(vxlan, true);
|
|
vxlan_flush(vxlan, true);
|
|
|
|
|
|
- spin_lock(&vn->sock_lock);
|
|
|
|
- if (!hlist_unhashed(&vxlan->hlist))
|
|
|
|
- hlist_del_rcu(&vxlan->hlist);
|
|
|
|
- spin_unlock(&vn->sock_lock);
|
|
|
|
-
|
|
|
|
gro_cells_destroy(&vxlan->gro_cells);
|
|
gro_cells_destroy(&vxlan->gro_cells);
|
|
list_del(&vxlan->next);
|
|
list_del(&vxlan->next);
|
|
unregister_netdevice_queue(dev, head);
|
|
unregister_netdevice_queue(dev, head);
|