bonding: fix enslaving in alb mode when link down
authorJiri Bohac <jbohac@suse.cz>
Wed, 18 Jan 2012 12:24:54 +0000 (12:24 +0000)
committerSimone Willett <swillett@nvidia.com>
Wed, 8 Feb 2012 22:31:06 +0000 (14:31 -0800)
commite03494a6eecd68b0665bcf39bb14ab745022ef2a
tree5f15696b44fac0c2818225e28e829d817226c75e
parentef14c366c8b137b63a045f49448422296d0f15f9
bonding: fix enslaving in alb mode when link down

[ Upstream commit b924551bed09f61b64f21bffe241afc5526b091a ]

bond_alb_init_slave() is called from bond_enslave() and sets the slave's MAC
address. This is done differently for TLB and ALB modes.
bond->alb_info.rlb_enabled is used to discriminate between the two modes but
this flag may be uninitialized if the slave is being enslaved prior to calling
bond_open() -> bond_alb_initialize() on the master.

It turns out all the callers of alb_set_slave_mac_addr() pass
bond->alb_info.rlb_enabled as the hw parameter.

This patch cleans up the unnecessary parameter of alb_set_slave_mac_addr() and
makes the function decide based on the bonding mode instead, which fixes the
above problem.

Reported-by: Narendra K <Narendra_K@Dell.com>
Signed-off-by: Jiri Bohac <jbohac@suse.cz>
Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Change-Id: I83909e006b8e2dcbe35c35c80f2e236e7e4743bf
Reviewed-on: http://git-master/r/79692
Reviewed-by: Automatic_Commit_Validation_User
drivers/net/bonding/bond_alb.c