]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - drivers/net/wan/lapbether.c
[NET]: Make device event notification network namespace safe
[net-next-2.6.git] / drivers / net / wan / lapbether.c
index 6c302e9dbca2e2ee2aeabf570e0c37cca193c88b..699b93406dfbe10c83d2d81c2ab5d036b2deb29c 100644 (file)
@@ -91,6 +91,9 @@ static int lapbeth_rcv(struct sk_buff *skb, struct net_device *dev, struct packe
        int len, err;
        struct lapbethdev *lapbeth;
 
+       if (dev->nd_net != &init_net)
+               goto drop;
+
        if ((skb = skb_share_check(skb, GFP_ATOMIC)) == NULL)
                return NET_RX_DROP;
 
@@ -391,6 +394,9 @@ static int lapbeth_device_event(struct notifier_block *this,
        struct lapbethdev *lapbeth;
        struct net_device *dev = ptr;
 
+       if (dev->nd_net != &init_net)
+               return NOTIFY_DONE;
+
        if (!dev_is_ethdev(dev))
                return NOTIFY_DONE;