Commit b382dfd2 authored by Amir Noam's avatar Amir Noam Committed by Stephen Hemminger

[bonding 2.6] fix kernel panic when optional feature used

parent 476d7328
...@@ -1559,11 +1559,14 @@ static int bond_enslave(struct net_device *master_dev, ...@@ -1559,11 +1559,14 @@ static int bond_enslave(struct net_device *master_dev,
#endif #endif
bond_set_slave_inactive_flags(new_slave); bond_set_slave_inactive_flags(new_slave);
} }
if (((struct in_device *)slave_dev->ip_ptr) != NULL) {
read_lock_irqsave(&(((struct in_device *)slave_dev->ip_ptr)->lock), rflags); read_lock_irqsave(&(((struct in_device *)slave_dev->ip_ptr)->lock), rflags);
ifap= &(((struct in_device *)slave_dev->ip_ptr)->ifa_list); ifap= &(((struct in_device *)slave_dev->ip_ptr)->ifa_list);
ifa = *ifap; ifa = *ifap;
if (ifa != NULL)
my_ip = ifa->ifa_address; my_ip = ifa->ifa_address;
read_unlock_irqrestore(&(((struct in_device *)slave_dev->ip_ptr)->lock), rflags); read_unlock_irqrestore(&(((struct in_device *)slave_dev->ip_ptr)->lock), rflags);
}
/* if there is a primary slave, remember it */ /* if there is a primary slave, remember it */
if (primary != NULL) { if (primary != NULL) {
...@@ -2730,9 +2733,7 @@ static void activebackup_arp_monitor(struct net_device *master) ...@@ -2730,9 +2733,7 @@ static void activebackup_arp_monitor(struct net_device *master)
/* the current slave must tx an arp to ensure backup slaves /* the current slave must tx an arp to ensure backup slaves
* rx traffic * rx traffic
*/ */
if ((slave != NULL) && if ((slave != NULL) && (my_ip != 0)) {
(((jiffies - slave->dev->last_rx) >= the_delta_in_ticks) &&
(my_ip != 0))) {
arp_send_all(slave); arp_send_all(slave);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment