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: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Patrick McHardy <kaber@trash.net>
This commit is contained in:
committed by
Patrick McHardy
parent
0e6e75af92
commit
b8b8063e0d
@@ -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,
|
|||||||
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user