All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 5/10] [bonding 2.6] fix change active command
@ 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:18:02 2003
+++ b/drivers/net/bonding/bond_main.c	Thu Sep  4 20:18:03 2003
@@ -1720,20 +1720,29 @@ static int bond_change_active(struct net
 		}
 	}
 
+	/*
+	 * Changing to the current active: do nothing; return success.
+	 */
+	if (newactive && (newactive == oldactive)) {
+		write_unlock_bh(&bond->lock);
+		return 0;
+	}
+
 	if ((newactive != NULL)&&
 	    (oldactive != NULL)&&
-	    (newactive != oldactive)&&
 	    (newactive->link == BOND_LINK_UP)&&
 	    IS_UP(newactive->dev)) {
-		bond_set_slave_inactive_flags(oldactive);
-		bond_set_slave_active_flags(newactive);
+		if (bond_mode == BOND_MODE_ACTIVEBACKUP) {
+			bond_set_slave_inactive_flags(oldactive);
+			bond_set_slave_active_flags(newactive);
+		}
+
 		bond_mc_update(bond, newactive, oldactive);
 		bond_assign_current_slave(bond, newactive);
 		printk("%s : activate %s(old : %s)\n",
 			master_dev->name, newactive->dev->name, 
 			oldactive->dev->name);
-	}
-	else {
+	} else {
 		ret = -EINVAL;
 	}
 	write_unlock_bh(&bond->lock);

^ 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 5/10] [bonding 2.6] fix change active command Amir Noam

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.