summaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding/bond_main.c
diff options
context:
space:
mode:
authorJiri Pirko2010-05-19 03:14:29 +0200
committerDavid S. Miller2010-06-02 13:16:23 +0200
commitc20811a79e671a6a1fe86a8c1afe04aca8a7f085 (patch)
tree21c68c6a711de84781dff4a561566dc0e325959b /drivers/net/bonding/bond_main.c
parentnet/mpc52xx_phy: Various code cleanups (diff)
downloadkernel-qcow2-linux-c20811a79e671a6a1fe86a8c1afe04aca8a7f085.tar.gz
kernel-qcow2-linux-c20811a79e671a6a1fe86a8c1afe04aca8a7f085.tar.xz
kernel-qcow2-linux-c20811a79e671a6a1fe86a8c1afe04aca8a7f085.zip
bonding: move dev_addr cpy to bond_enslave
Move the code that copies slave's mac address in case that's the first slave into bond_enslave. Ifenslave app does this also but that's not a problem. This is something that should be done in bond_enslave, and it shound not matter from where is it called. Signed-off-by: Jiri Pirko <jpirko@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bonding/bond_main.c')
-rw-r--r--drivers/net/bonding/bond_main.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 2c3f9db91b50..4e7473e557ff 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1522,6 +1522,13 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
}
}
+ /* If this is the first slave, then we need to set the master's hardware
+ * address to be the same as the slave's. */
+ if (bond->slave_cnt == 0)
+ memcpy(bond->dev->dev_addr, slave_dev->dev_addr,
+ slave_dev->addr_len);
+
+
new_slave = kzalloc(sizeof(struct slave), GFP_KERNEL);
if (!new_slave) {
res = -ENOMEM;