diff options
author | Anders Roxell <anders.roxell@linaro.org> | 2016-08-10 12:11:15 +0200 |
---|---|---|
committer | Anders Roxell <anders.roxell@linaro.org> | 2016-08-10 12:11:15 +0200 |
commit | a44038112d3379f49df8a9db3e1259d9e945faee (patch) | |
tree | 198f8ef7dcba389b87dbd3cac861d896b5bfd77d /net/ipv4/netfilter/nf_nat_masquerade_ipv4.c | |
parent | 590e935df0c94b2d7a4584bb26906666176a6133 (diff) | |
parent | 0e790100f1c49f32a390d0cc55801230fd04ba56 (diff) |
Merge remote-tracking branch 'lsk/linux-linaro-lsk-v3.18' into linux-linaro-lsk-v3.18-rtlsk-v3.18-16.09-rtlinux-linaro-lsk-v3.18-rt-test
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
Conflicts:
kernel/futex.c
kernel/printk/printk.c
kernel/softirq.c
mm/slub.c
mm/swap.c
Diffstat (limited to 'net/ipv4/netfilter/nf_nat_masquerade_ipv4.c')
-rw-r--r-- | net/ipv4/netfilter/nf_nat_masquerade_ipv4.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/net/ipv4/netfilter/nf_nat_masquerade_ipv4.c b/net/ipv4/netfilter/nf_nat_masquerade_ipv4.c index c6eb42100e9a..ea91058b5f6f 100644 --- a/net/ipv4/netfilter/nf_nat_masquerade_ipv4.c +++ b/net/ipv4/netfilter/nf_nat_masquerade_ipv4.c @@ -108,10 +108,18 @@ static int masq_inet_event(struct notifier_block *this, unsigned long event, void *ptr) { - struct net_device *dev = ((struct in_ifaddr *)ptr)->ifa_dev->dev; + struct in_device *idev = ((struct in_ifaddr *)ptr)->ifa_dev; struct netdev_notifier_info info; - netdev_notifier_info_init(&info, dev); + /* The masq_dev_notifier will catch the case of the device going + * down. So if the inetdev is dead and being destroyed we have + * no work to do. Otherwise this is an individual address removal + * and we have to perform the flush. + */ + if (idev->dead) + return NOTIFY_DONE; + + netdev_notifier_info_init(&info, idev->dev); return masq_device_event(this, event, &info); } |