netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 4/10] [bonding 2.6] fix kernel panic when optional feature used
@ 2003-09-04 17:44 Amir Noam
  0 siblings, 0 replies; only message in thread
From: Amir Noam @ 2003-09-04 17:44 UTC (permalink / raw)
  To: bonding-devel, netdev

diff -Nuarp a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
--- a/drivers/net/bonding/bond_main.c	Thu Sep  4 20:17:59 2003
+++ b/drivers/net/bonding/bond_main.c	Thu Sep  4 20:18:01 2003
@@ -1559,11 +1559,14 @@ static int bond_enslave(struct net_devic
 #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(str
 		/* 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);
 		}
 	}
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-09-04 17:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-09-04 17:44 [PATCH 4/10] [bonding 2.6] fix kernel panic when optional feature used Amir Noam

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).