]> err.no Git - linux-2.6/blobdiff - net/ipv4/arp.c
[MAC80211]: remove turbo modes
[linux-2.6] / net / ipv4 / arp.c
index 9ab9d534fbac28597f0a5b2b5c0c07d3e4485f29..3a683006d761ea10d64ca2d926b5b3c122b5f315 100644 (file)
 #include <linux/sysctl.h>
 #endif
 
+#include <net/net_namespace.h>
 #include <net/ip.h>
 #include <net/icmp.h>
 #include <net/route.h>
@@ -931,6 +932,9 @@ static int arp_rcv(struct sk_buff *skb, struct net_device *dev,
 {
        struct arphdr *arp;
 
+       if (dev->nd_net != &init_net)
+               goto freeskb;
+
        /* ARP header, plus 2 device addresses, plus 2 IP addresses.  */
        if (!pskb_may_pull(skb, (sizeof(struct arphdr) +
                                 (2 * dev->addr_len) +
@@ -977,7 +981,7 @@ static int arp_req_set(struct arpreq *r, struct net_device * dev)
                if (mask && mask != htonl(0xFFFFFFFF))
                        return -EINVAL;
                if (!dev && (r->arp_flags & ATF_COM)) {
-                       dev = dev_getbyhwaddr(r->arp_ha.sa_family, r->arp_ha.sa_data);
+                       dev = dev_getbyhwaddr(&init_net, r->arp_ha.sa_family, r->arp_ha.sa_data);
                        if (!dev)
                                return -ENODEV;
                }
@@ -1165,7 +1169,7 @@ int arp_ioctl(unsigned int cmd, void __user *arg)
        rtnl_lock();
        if (r.arp_dev[0]) {
                err = -ENODEV;
-               if ((dev = __dev_get_by_name(r.arp_dev)) == NULL)
+               if ((dev = __dev_get_by_name(&init_net, r.arp_dev)) == NULL)
                        goto out;
 
                /* Mmmm... It is wrong... ARPHRD_NETROM==0 */
@@ -1201,6 +1205,9 @@ static int arp_netdev_event(struct notifier_block *this, unsigned long event, vo
 {
        struct net_device *dev = ptr;
 
+       if (dev->nd_net != &init_net)
+               return NOTIFY_DONE;
+
        switch (event) {
        case NETDEV_CHANGEADDR:
                neigh_changeaddr(&arp_tbl, dev);
@@ -1400,7 +1407,7 @@ static const struct file_operations arp_seq_fops = {
 
 static int __init arp_proc_init(void)
 {
-       if (!proc_net_fops_create("arp", S_IRUGO, &arp_seq_fops))
+       if (!proc_net_fops_create(&init_net, "arp", S_IRUGO, &arp_seq_fops))
                return -ENOMEM;
        return 0;
 }