]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - net/core/rtnetlink.c
[NET]: Make device event notification network namespace safe
[net-next-2.6.git] / net / core / rtnetlink.c
index dca9e80ba574b2fe2a164f9a4fc7ab360d8f3520..41859508bedd8d7455daa4702ea3e1928989bb06 100644 (file)
@@ -1286,6 +1286,10 @@ static void rtnetlink_rcv(struct sock *sk, int len)
 static int rtnetlink_event(struct notifier_block *this, unsigned long event, void *ptr)
 {
        struct net_device *dev = ptr;
+
+       if (dev->nd_net != &init_net)
+               return NOTIFY_DONE;
+
        switch (event) {
        case NETDEV_UNREGISTER:
                rtmsg_ifinfo(RTM_DELLINK, dev, ~0U);