Skip to content

Commit

Permalink
bond: check if slave count is 0 in case when deciding to take slave's…
Browse files Browse the repository at this point in the history
… mac

in bond_enslave(), check slave_cnt before actually using slave address.

introduced by:
commit 409cc1f (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>
  • Loading branch information
Jiri Pirko authored and David S. Miller committed Feb 26, 2013
1 parent 0237c11 commit 6c8c4e4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/bonding/bond_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1629,7 +1629,7 @@ 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->dev_addr_from_first)
if (bond->slave_cnt == 0 && bond->dev_addr_from_first)
bond_set_dev_addr(bond->dev, slave_dev);

new_slave = kzalloc(sizeof(struct slave), GFP_KERNEL);
Expand Down

0 comments on commit 6c8c4e4

Please sign in to comment.