]> git.hungrycats.org Git - linux/commitdiff
[bonding 2.6] fix kernel panic when optional feature used
authorAmir Noam <amir.noam@intel.com>
Thu, 11 Sep 2003 10:52:43 +0000 (06:52 -0400)
committerStephen Hemminger <shemminger@osdl.org>
Thu, 11 Sep 2003 10:52:43 +0000 (06:52 -0400)
drivers/net/bonding/bond_main.c

index 8cfb4b71d628fde8a22e1baaccc0b672dbfd471b..582b8a67bcc275a42b84fa2cb4873ae72d9f462e 100644 (file)
@@ -1559,11 +1559,14 @@ static int bond_enslave(struct net_device *master_dev,
 #endif
                        bond_set_slave_inactive_flags(new_slave);
                }
-               read_lock_irqsave(&(((struct in_device *)slave_dev->ip_ptr)->lock), rflags);
-               ifap= &(((struct in_device *)slave_dev->ip_ptr)->ifa_list);
-               ifa = *ifap;
-               my_ip = ifa->ifa_address;
-               read_unlock_irqrestore(&(((struct in_device *)slave_dev->ip_ptr)->lock), rflags);
+               if (((struct in_device *)slave_dev->ip_ptr) != NULL) {
+                       read_lock_irqsave(&(((struct in_device *)slave_dev->ip_ptr)->lock), rflags);
+                       ifap= &(((struct in_device *)slave_dev->ip_ptr)->ifa_list);
+                       ifa = *ifap;
+                       if (ifa != NULL)
+                               my_ip = ifa->ifa_address;
+                       read_unlock_irqrestore(&(((struct in_device *)slave_dev->ip_ptr)->lock), rflags);
+               }
 
                /* if there is a primary slave, remember it */
                if (primary != NULL) {
@@ -2730,10 +2733,8 @@ static void activebackup_arp_monitor(struct net_device *master)
                /* the current slave must tx an arp to ensure backup slaves
                 * rx traffic
                 */
-               if ((slave != NULL) &&
-                   (((jiffies - slave->dev->last_rx) >= the_delta_in_ticks) &&
-                    (my_ip != 0))) {
-                 arp_send_all(slave);
+               if ((slave != NULL) && (my_ip != 0)) {
+                       arp_send_all(slave);
                }
        }