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.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 11d01d67b3f5..6bbd90e1123c 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1629,7 +1629,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
1629 1629
1630 /* If this is the first slave, then we need to set the master's hardware 1630 /* If this is the first slave, then we need to set the master's hardware
1631 * address to be the same as the slave's. */ 1631 * address to be the same as the slave's. */
1632 if (bond->dev_addr_from_first) 1632 if (bond->slave_cnt == 0 && bond->dev_addr_from_first)
1633 bond_set_dev_addr(bond->dev, slave_dev); 1633 bond_set_dev_addr(bond->dev, slave_dev);
1634 1634
1635 new_slave = kzalloc(sizeof(struct slave), GFP_KERNEL); 1635 new_slave = kzalloc(sizeof(struct slave), GFP_KERNEL);
@@ -1746,6 +1746,8 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
1746 1746
1747 bond_compute_features(bond); 1747 bond_compute_features(bond);
1748 1748
1749 bond_update_speed_duplex(new_slave);
1750
1749 read_lock(&bond->lock); 1751 read_lock(&bond->lock);
1750 1752
1751 new_slave->last_arp_rx = jiffies - 1753 new_slave->last_arp_rx = jiffies -
@@ -1798,8 +1800,6 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
1798 new_slave->link == BOND_LINK_DOWN ? "DOWN" : 1800 new_slave->link == BOND_LINK_DOWN ? "DOWN" :
1799 (new_slave->link == BOND_LINK_UP ? "UP" : "BACK")); 1801 (new_slave->link == BOND_LINK_UP ? "UP" : "BACK"));
1800 1802
1801 bond_update_speed_duplex(new_slave);
1802
1803 if (USES_PRIMARY(bond->params.mode) && bond->params.primary[0]) { 1803 if (USES_PRIMARY(bond->params.mode) && bond->params.primary[0]) {
1804 /* if there is a primary slave, remember it */ 1804 /* if there is a primary slave, remember it */
1805 if (strcmp(bond->params.primary, new_slave->dev->name) == 0) { 1805 if (strcmp(bond->params.primary, new_slave->dev->name) == 0) {
@@ -1964,7 +1964,6 @@ static int __bond_release_one(struct net_device *bond_dev,
1964 } 1964 }
1965 1965
1966 block_netpoll_tx(); 1966 block_netpoll_tx();
1967 call_netdevice_notifiers(NETDEV_RELEASE, bond_dev);
1968 write_lock_bh(&bond->lock); 1967 write_lock_bh(&bond->lock);
1969 1968
1970 slave = bond_get_slave_by_dev(bond, slave_dev); 1969 slave = bond_get_slave_by_dev(bond, slave_dev);
@@ -2066,8 +2065,10 @@ static int __bond_release_one(struct net_device *bond_dev,
2066 write_unlock_bh(&bond->lock); 2065 write_unlock_bh(&bond->lock);
2067 unblock_netpoll_tx(); 2066 unblock_netpoll_tx();
2068 2067
2069 if (bond->slave_cnt == 0) 2068 if (bond->slave_cnt == 0) {
2070 call_netdevice_notifiers(NETDEV_CHANGEADDR, bond->dev); 2069 call_netdevice_notifiers(NETDEV_CHANGEADDR, bond->dev);
2070 call_netdevice_notifiers(NETDEV_RELEASE, bond->dev);
2071 }
2071 2072
2072 bond_compute_features(bond); 2073 bond_compute_features(bond);
2073 if (!(bond_dev->features & NETIF_F_VLAN_CHALLENGED) && 2074 if (!(bond_dev->features & NETIF_F_VLAN_CHALLENGED) &&
@@ -2373,8 +2374,6 @@ static void bond_miimon_commit(struct bonding *bond)
2373 bond_set_backup_slave(slave); 2374 bond_set_backup_slave(slave);
2374 } 2375 }
2375 2376
2376 bond_update_speed_duplex(slave);
2377
2378 pr_info("%s: link status definitely up for interface %s, %u Mbps %s duplex.\n", 2377 pr_info("%s: link status definitely up for interface %s, %u Mbps %s duplex.\n",
2379 bond->dev->name, slave->dev->name, 2378 bond->dev->name, slave->dev->name,
2380 slave->speed, slave->duplex ? "full" : "half"); 2379 slave->speed, slave->duplex ? "full" : "half");