提交 0e424599 编写于 作者: H Hristo Venev 提交者: Yang Yingliang

net: ip6_tunnel: Unregister catch-all devices

stable inclusion
from linux-4.19.189
commit e4cb6ee364ddd274c4faf5cb4baa1c397c72584b

--------------------------------

commit 941ea91e upstream.

Similarly to the sit case, we need to remove the tunnels with no
addresses that have been moved to another network namespace.

Fixes: 0bd87628 ("ip6tnl: add x-netns support")
Signed-off-by: NHristo Venev <hristo@venev.name>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 5b53e9fb
...@@ -2222,6 +2222,16 @@ static void __net_exit ip6_tnl_destroy_tunnels(struct net *net, struct list_head ...@@ -2222,6 +2222,16 @@ static void __net_exit ip6_tnl_destroy_tunnels(struct net *net, struct list_head
t = rtnl_dereference(t->next); 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) static int __net_init ip6_tnl_init_net(struct net *net)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册