]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/ipv4/ipconfig.c
[NET]: Make packet reception network namespace safe
[linux-2.6-omap-h63xx.git] / net / ipv4 / ipconfig.c
index 5ae4849878a32678aa6e622eaba45dd6b1ef3f73..08ff623371f08252d24d261a55275794267fa948 100644 (file)
@@ -426,6 +426,9 @@ ic_rarp_recv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt
        unsigned char *sha, *tha;               /* s for "source", t for "target" */
        struct ic_device *d;
 
+       if (dev->nd_net != &init_net)
+               goto drop;
+
        if ((skb = skb_share_check(skb, GFP_ATOMIC)) == NULL)
                return NET_RX_DROP;
 
@@ -835,6 +838,9 @@ static int __init ic_bootp_recv(struct sk_buff *skb, struct net_device *dev, str
        struct ic_device *d;
        int len, ext_len;
 
+       if (dev->nd_net != &init_net)
+               goto drop;
+
        /* Perform verifications before taking the lock.  */
        if (skb->pkt_type == PACKET_OTHERHOST)
                goto drop;