[NET]: Make device event notification network namespace safe
[safe/jmp/linux-2.6] / net / ipv4 / netfilter / ip_queue.c
index cb5e61a..d918560 100644 (file)
@@ -557,6 +557,9 @@ ipq_rcv_dev_event(struct notifier_block *this,
 {
        struct net_device *dev = ptr;
 
+       if (dev->nd_net != &init_net)
+               return NOTIFY_DONE;
+
        /* Drop any packets associated with the downed device */
        if (event == NETDEV_DOWN)
                ipq_dev_drop(dev->ifindex);