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.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 5e12462a9d5e..2c3f9db91b50 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1533,6 +1533,14 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
1533 */ 1533 */
1534 new_slave->original_flags = slave_dev->flags; 1534 new_slave->original_flags = slave_dev->flags;
1535 1535
1536 /* Save slave's original mtu and then set it to match the bond */
1537 new_slave->original_mtu = slave_dev->mtu;
1538 res = dev_set_mtu(slave_dev, bond->dev->mtu);
1539 if (res) {
1540 pr_debug("Error %d calling dev_set_mtu\n", res);
1541 goto err_free;
1542 }
1543
1536 /* 1544 /*
1537 * Save slave's original ("permanent") mac address for modes 1545 * Save slave's original ("permanent") mac address for modes
1538 * that need it, and for restoring it upon release, and then 1546 * that need it, and for restoring it upon release, and then
@@ -1550,7 +1558,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
1550 res = dev_set_mac_address(slave_dev, &addr); 1558 res = dev_set_mac_address(slave_dev, &addr);
1551 if (res) { 1559 if (res) {
1552 pr_debug("Error %d calling set_mac_address\n", res); 1560 pr_debug("Error %d calling set_mac_address\n", res);
1553 goto err_free; 1561 goto err_restore_mtu;
1554 } 1562 }
1555 } 1563 }
1556 1564
@@ -1785,6 +1793,9 @@ err_restore_mac:
1785 dev_set_mac_address(slave_dev, &addr); 1793 dev_set_mac_address(slave_dev, &addr);
1786 } 1794 }
1787 1795
1796err_restore_mtu:
1797 dev_set_mtu(slave_dev, new_slave->original_mtu);
1798
1788err_free: 1799err_free:
1789 kfree(new_slave); 1800 kfree(new_slave);
1790 1801
@@ -1969,6 +1980,8 @@ int bond_release(struct net_device *bond_dev, struct net_device *slave_dev)
1969 dev_set_mac_address(slave_dev, &addr); 1980 dev_set_mac_address(slave_dev, &addr);
1970 } 1981 }
1971 1982
1983 dev_set_mtu(slave_dev, slave->original_mtu);
1984
1972 slave_dev->priv_flags &= ~(IFF_MASTER_8023AD | IFF_MASTER_ALB | 1985 slave_dev->priv_flags &= ~(IFF_MASTER_8023AD | IFF_MASTER_ALB |
1973 IFF_SLAVE_INACTIVE | IFF_BONDING | 1986 IFF_SLAVE_INACTIVE | IFF_BONDING |
1974 IFF_SLAVE_NEEDARP); 1987 IFF_SLAVE_NEEDARP);