Re: [PATCH] bonding: check for assigned mac before adopting the slaves mac address

Previous thread: [RFC PATCH 0/2] per cgroup timer slack and freezer duty cycle by jacob.jun.pan on Wednesday, December 1, 2010 - 12:00 pm. (7 messages)

Next thread: [PATCH] ath: Convert ath_print to ath_dbg by Joe Perches on Wednesday, December 1, 2010 - 1:32 pm. (1 message)
From: David Strand
Date: Wednesday, December 1, 2010 - 12:15 pm

Restore the check for an unassigned mac address before adopting the
first slaves as it's own. The change in behavior was introduced with
the following patch:
http://git.kernel.org/?p=linux/kernel/git/stable/linux-2.6.36.y.git;a=commit;h=c20811a...

Signed-off-by: David Strand <dpstrand@gmail.com>
---
diff -uprN a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
--- a/drivers/net/bonding/bond_main.c	2010-11-24 11:36:58.125640000 -0800
+++ b/drivers/net/bonding/bond_main.c	2010-12-01 10:12:33.728640001 -0800
@@ -1576,7 +1576,7 @@ int bond_enslave(struct net_device *bond

 	/* If this is the first slave, then we need to set the master's hardware
 	 * address to be the same as the slave's. */
-	if (bond->slave_cnt == 0)
+	if (is_zero_ether_addr(bond->dev->dev_addr))
 		memcpy(bond->dev->dev_addr, slave_dev->dev_addr,
 		       slave_dev->addr_len);
--

From: Jay Vosburgh
Date: Wednesday, December 1, 2010 - 12:21 pm

From: David Strand <dpstrand@gmail.com>

Restore the check for an unassigned mac address before adopting the
first slaves as it's own. The change in behavior was introduced by:

commit c20811a79e671a6a1fe86a8c1afe04aca8a7f085
Author: Jiri Pirko <jpirko@redhat.com>

    bonding: move dev_addr cpy to bond_enslave


Signed-off-by: David Strand <dpstrand@gmail.com>
Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>

---
diff -uprN a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
--- a/drivers/net/bonding/bond_main.c	2010-11-24 11:36:58.125640000 -0800
+++ b/drivers/net/bonding/bond_main.c	2010-12-01 10:12:33.728640001 -0800
@@ -1576,7 +1576,7 @@ int bond_enslave(struct net_device *bond

 	/* If this is the first slave, then we need to set the master's hardware
 	 * address to be the same as the slave's. */
-	if (bond->slave_cnt == 0)
+	if (is_zero_ether_addr(bond->dev->dev_addr))
 		memcpy(bond->dev->dev_addr, slave_dev->dev_addr,
 		       slave_dev->addr_len);
--

From: David Miller
Date: Wednesday, December 1, 2010 - 12:43 pm

From: Jay Vosburgh <fubar@us.ibm.com>

Applied, thanks.
--

Previous thread: [RFC PATCH 0/2] per cgroup timer slack and freezer duty cycle by jacob.jun.pan on Wednesday, December 1, 2010 - 12:00 pm. (7 messages)

Next thread: [PATCH] ath: Convert ath_print to ath_dbg by Joe Perches on Wednesday, December 1, 2010 - 1:32 pm. (1 message)