* [net-next] bond: set mac address only if necessary
@ 2016-03-29 15:14 Zhang Shengju
2016-03-30 19:47 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Zhang Shengju @ 2016-03-29 15:14 UTC (permalink / raw)
To: j.vosburgh, vfalico, gospo; +Cc: netdev
Bond device gets it's mac address from the first slave device, it's not
necessary to set slave device's mac address to bond if equal.
Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
---
drivers/net/bonding/bond_main.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 97fad05..6569219 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1473,8 +1473,9 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
*/
ether_addr_copy(new_slave->perm_hwaddr, slave_dev->dev_addr);
- if (!bond->params.fail_over_mac ||
- BOND_MODE(bond) != BOND_MODE_ACTIVEBACKUP) {
+ if ((!bond->params.fail_over_mac ||
+ BOND_MODE(bond) != BOND_MODE_ACTIVEBACKUP) &&
+ !ether_addr_equal_64bits(bond_dev->dev_addr, slave_dev->dev_addr)) {
/* Set slave to master's mac address. The application already
* set the master's mac address to that of the first slave
*/
--
1.8.3.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-03-30 19:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-29 15:14 [net-next] bond: set mac address only if necessary Zhang Shengju
2016-03-30 19:47 ` David Miller
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).