diff options
author | Jiri Pirko <jiri@resnulli.us> | 2013-02-25 17:26:15 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-02-26 17:30:38 -0500 |
commit | 6c8c4e4c24b9f6cee3d356a51e4a7f2af787a49b (patch) | |
tree | 7fad067bef292f4227966b484952080e4f26fdf5 | |
parent | 0237c11044b3670adcbe80cd6dd721285347f497 (diff) |
bond: check if slave count is 0 in case when deciding to take slave's mac
in bond_enslave(), check slave_cnt before actually using slave address.
introduced by:
commit 409cc1f8a41 (bond: have random dev address by default instead of zeroes)
Reported-by: Greg Rose <gregory.v.rose@intel.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/bonding/bond_main.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 11d01d67b3f5..7bd068a6056a 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); |