Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
[safe/jmp/linux-2.6] / drivers / net / bonding / bond_main.c
index 0f06753..ecfaf14 100644 (file)
@@ -2629,7 +2629,7 @@ static int bond_arp_rcv(struct sk_buff *skb, struct net_device *dev, struct pack
        unsigned char *arp_ptr;
        __be32 sip, tip;
 
-       if (dev->nd_net != &init_net)
+       if (dev_net(dev) != &init_net)
                goto out;
 
        if (!(dev->priv_flags & IFF_BONDING) || !(dev->flags & IFF_MASTER))
@@ -2646,10 +2646,7 @@ static int bond_arp_rcv(struct sk_buff *skb, struct net_device *dev, struct pack
        if (!slave || !slave_do_arp_validate(bond, slave))
                goto out_unlock;
 
-       /* ARP header, plus 2 device addresses, plus 2 IP addresses.  */
-       if (!pskb_may_pull(skb, (sizeof(struct arphdr) +
-                                (2 * dev->addr_len) +
-                                (2 * sizeof(u32)))))
+       if (!pskb_may_pull(skb, arp_hdr_len(dev)))
                goto out_unlock;
 
        arp = arp_hdr(skb);
@@ -3473,7 +3470,7 @@ static int bond_netdev_event(struct notifier_block *this, unsigned long event, v
 {
        struct net_device *event_dev = (struct net_device *)ptr;
 
-       if (event_dev->nd_net != &init_net)
+       if (dev_net(event_dev) != &init_net)
                return NOTIFY_DONE;
 
        dprintk("event_dev: %s, event: %lx\n",
@@ -3511,6 +3508,9 @@ static int bond_inetaddr_event(struct notifier_block *this, unsigned long event,
        struct bonding *bond, *bond_next;
        struct vlan_entry *vlan, *vlan_next;
 
+       if (dev_net(ifa->ifa_dev->dev) != &init_net)
+               return NOTIFY_DONE;
+
        list_for_each_entry_safe(bond, bond_next, &bond_dev_list, bond_list) {
                if (bond->dev == event_dev) {
                        switch (event) {