Skip to content

Commit

Permalink
net: ip6_tunnel: Unregister catch-all devices
Browse files Browse the repository at this point in the history
Similarly to the sit case, we need to remove the tunnels with no
addresses that have been moved to another network namespace.

Fixes: 0bd8762 ("ip6tnl: add x-netns support")
Signed-off-by: Hristo Venev <hristo@venev.name>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Hristo Venev authored and David S. Miller committed Apr 13, 2021
1 parent 610f8c0 commit 941ea91
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions net/ipv6/ip6_tunnel.c
Original file line number Diff line number Diff line change
Expand Up @@ -2244,6 +2244,16 @@ static void __net_exit ip6_tnl_destroy_tunnels(struct net *net, struct list_head
t = rtnl_dereference(t->next);
}
}

t = rtnl_dereference(ip6n->tnls_wc[0]);
while (t) {
/* If dev is in the same netns, it has already
* been added to the list by the previous loop.
*/
if (!net_eq(dev_net(t->dev), net))
unregister_netdevice_queue(t->dev, list);
t = rtnl_dereference(t->next);
}
}

static int __net_init ip6_tnl_init_net(struct net *net)
Expand Down

0 comments on commit 941ea91

Please sign in to comment.