aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding/bond_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/bonding/bond_main.c')
-rw-r--r--drivers/net/bonding/bond_main.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 2e8b9f1e2747..0da3c126c7c4 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1596,7 +1596,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
1596 1596
1597 /* If this is the first slave, then we need to set the master's hardware 1597 /* If this is the first slave, then we need to set the master's hardware
1598 * address to be the same as the slave's. */ 1598 * address to be the same as the slave's. */
1599 if (bond->slave_cnt == 0 && bond->dev_addr_from_first) 1599 if (!bond->slave_cnt && bond->dev->addr_assign_type == NET_ADDR_RANDOM)
1600 bond_set_dev_addr(bond->dev, slave_dev); 1600 bond_set_dev_addr(bond->dev, slave_dev);
1601 1601
1602 new_slave = kzalloc(sizeof(struct slave), GFP_KERNEL); 1602 new_slave = kzalloc(sizeof(struct slave), GFP_KERNEL);
@@ -2041,7 +2041,6 @@ static int __bond_release_one(struct net_device *bond_dev,
2041 if (bond->slave_cnt == 0) { 2041 if (bond->slave_cnt == 0) {
2042 bond_set_carrier(bond); 2042 bond_set_carrier(bond);
2043 eth_hw_addr_random(bond_dev); 2043 eth_hw_addr_random(bond_dev);
2044 bond->dev_addr_from_first = true;
2045 2044
2046 if (bond_vlan_used(bond)) { 2045 if (bond_vlan_used(bond)) {
2047 pr_warning("%s: Warning: clearing HW address of %s while it still has VLANs.\n", 2046 pr_warning("%s: Warning: clearing HW address of %s while it still has VLANs.\n",
@@ -4800,10 +4799,8 @@ static int bond_init(struct net_device *bond_dev)
4800 4799
4801 /* Ensure valid dev_addr */ 4800 /* Ensure valid dev_addr */
4802 if (is_zero_ether_addr(bond_dev->dev_addr) && 4801 if (is_zero_ether_addr(bond_dev->dev_addr) &&
4803 bond_dev->addr_assign_type == NET_ADDR_PERM) { 4802 bond_dev->addr_assign_type == NET_ADDR_PERM)
4804 eth_hw_addr_random(bond_dev); 4803 eth_hw_addr_random(bond_dev);
4805 bond->dev_addr_from_first = true;
4806 }
4807 4804
4808 return 0; 4805 return 0;
4809} 4806}