Commit b8b8063e authored by Alexey Dobriyan's avatar Alexey Dobriyan Committed by Patrick McHardy

netfilter: netns nat: fix ipt_MASQUERADE in netns

First, allow entry in notifier hook.
Second, start conntrack cleanup in netns to which netdevice belongs.
Signed-off-by: default avatarAlexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
parent 0e6e75af
...@@ -119,9 +119,7 @@ static int masq_device_event(struct notifier_block *this, ...@@ -119,9 +119,7 @@ static int masq_device_event(struct notifier_block *this,
void *ptr) void *ptr)
{ {
const struct net_device *dev = ptr; const struct net_device *dev = ptr;
struct net *net = dev_net(dev);
if (!net_eq(dev_net(dev), &init_net))
return NOTIFY_DONE;
if (event == NETDEV_DOWN) { if (event == NETDEV_DOWN) {
/* Device was downed. Search entire table for /* Device was downed. Search entire table for
...@@ -129,7 +127,7 @@ static int masq_device_event(struct notifier_block *this, ...@@ -129,7 +127,7 @@ static int masq_device_event(struct notifier_block *this,
and forget them. */ and forget them. */
NF_CT_ASSERT(dev->ifindex != 0); NF_CT_ASSERT(dev->ifindex != 0);
nf_ct_iterate_cleanup(&init_net, device_cmp, nf_ct_iterate_cleanup(net, device_cmp,
(void *)(long)dev->ifindex); (void *)(long)dev->ifindex);
} }
......
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