[NET]: Make device event notification network namespace safe
[safe/jmp/linux-2.6] / net / core / dst.c
index c6a0587..32267a1 100644 (file)
@@ -15,6 +15,7 @@
 #include <linux/skbuff.h>
 #include <linux/string.h>
 #include <linux/types.h>
+#include <net/net_namespace.h>
 
 #include <net/dst.h>
 
@@ -252,6 +253,9 @@ static int dst_dev_event(struct notifier_block *this, unsigned long event, void
        struct net_device *dev = ptr;
        struct dst_entry *dst;
 
+       if (dev->nd_net != &init_net)
+               return NOTIFY_DONE;
+
        switch (event) {
        case NETDEV_UNREGISTER:
        case NETDEV_DOWN: