提交 6c8c4e4c 编写于 作者: J Jiri Pirko 提交者: David S. Miller

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 409cc1f8 (bond: have random dev address by default instead of zeroes)
Reported-by: NGreg Rose <gregory.v.rose@intel.com>
Signed-off-by: NJiri Pirko <jiri@resnulli.us>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 0237c110
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册