diff mbox

[REPOST,net-next-2.6,2/4] bonding: use compare_ether_addr

Message ID 1251497115-16234-3-git-send-email-fubar@us.ibm.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Jay Vosburgh Aug. 28, 2009, 10:05 p.m. UTC
From: Stephen Hemminger <shemminger@vyatta.com>

Bonding can use compare_ether_addr() in bond_release.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
---
 drivers/net/bonding/bond_main.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

Comments

David Miller Aug. 28, 2009, 10:49 p.m. UTC | #1
From: Jay Vosburgh <fubar@us.ibm.com>
Date: Fri, 28 Aug 2009 15:05:14 -0700

> From: Nicolas de Pesloüan <nicolas.2p.debian@free.fr>
> 
> max_bonds is of type int and cannot be greater than INT_MAX.
> 
> Signed-off-by: Nicolas de Pesloüan <nicolas.2p.debian@free.fr>
> Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>

It seems you use two different encodings here for Nicolas's
last name, and thus the two-dotted 'u' comes out corrupted
in the From: field.

This causes patchwork to not be able to parse the patch
and thus put it properly into the queue.  So all that's
in there are patches #1, #2 and #4.

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 1aeb36c..ed00ba9 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1796,7 +1796,6 @@  int bond_release(struct net_device *bond_dev, struct net_device *slave_dev)
 	struct bonding *bond = netdev_priv(bond_dev);
 	struct slave *slave, *oldcurrent;
 	struct sockaddr addr;
-	int mac_addr_differ;
 
 	/* slave is not a slave or master is not master of this slave */
 	if (!(slave_dev->flags & IFF_SLAVE) ||
@@ -1820,9 +1819,8 @@  int bond_release(struct net_device *bond_dev, struct net_device *slave_dev)
 	}
 
 	if (!bond->params.fail_over_mac) {
-		mac_addr_differ = memcmp(bond_dev->dev_addr, slave->perm_hwaddr,
-					 ETH_ALEN);
-		if (!mac_addr_differ && (bond->slave_cnt > 1))
+		if (!compare_ether_addr(bond_dev->dev_addr, slave->perm_hwaddr)
+		    && bond->slave_cnt > 1)
 			pr_warning(DRV_NAME
 			       ": %s: Warning: the permanent HWaddr of %s - "
 			       "%pM - is still in use by %s. "