[PATCH] mac80211: fix interface initialisation and deinitialisation
[cascardo/linux.git] / net / ipv6 / ip6_input.c
index be0ee8a..9149fc2 100644 (file)
@@ -61,6 +61,11 @@ int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt
        u32             pkt_len;
        struct inet6_dev *idev;
 
+       if (dev->nd_net != &init_net) {
+               kfree_skb(skb);
+               return 0;
+       }
+
        if (skb->pkt_type == PACKET_OTHERHOST) {
                kfree_skb(skb);
                return 0;
@@ -86,7 +91,7 @@ int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt
         *
         * BTW, when we send a packet for our own local address on a
         * non-loopback interface (e.g. ethX), it is being delivered
-        * via the loopback interface (lo) here; skb->dev = &loopback_dev.
+        * via the loopback interface (lo) here; skb->dev = loopback_dev.
         * It, however, should be considered as if it is being
         * arrived via the sending interface (ethX), because of the
         * nature of scoping architecture. --yoshfuji
@@ -235,7 +240,7 @@ int ip6_mc_input(struct sk_buff *skb)
        IP6_INC_STATS_BH(ip6_dst_idev(skb->dst), IPSTATS_MIB_INMCASTPKTS);
 
        hdr = ipv6_hdr(skb);
-       deliver = likely(!(skb->dev->flags & (IFF_PROMISC|IFF_ALLMULTI))) ||
+       deliver = unlikely(skb->dev->flags & (IFF_PROMISC|IFF_ALLMULTI)) ||
            ipv6_chk_mcast_addr(skb->dev, &hdr->daddr, NULL);
 
        /*