]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/core/dst.c
[NET]: Make device event notification network namespace safe
[linux-2.6-omap-h63xx.git] / net / core / dst.c
index c6a05879d58cd3c87fb854541bb3c3440d858de9..32267a16e01e0a2999f6f4ea0a444afdf879e293 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: