aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding/bond_main.c
diff options
context:
space:
mode:
authorPhil Oester <kernel@linuxace.com>2011-03-14 02:22:05 -0400
committerDavid S. Miller <davem@davemloft.net>2011-03-15 22:29:38 -0400
commite826eafa65c6f1f7c8db5a237556cebac57ebcc5 (patch)
tree4f88eb6bd3ae6e963ab02250f3051379e1d91276 /drivers/net/bonding/bond_main.c
parentfd0e435b0fe85622f167b84432552885a4856ac8 (diff)
bonding: Call netif_carrier_off after register_netdevice
Bringing up a bond interface with all network cables disconnected does not properly set the interface as DOWN because the call to netif_carrier_off occurs too early in bond_init. The call needs to occur after register_netdevice has set dev->reg_state to NETREG_REGISTERED, so that netif_carrier_off will trigger the call to linkwatch_fire_event. Signed-off-by: Phil Oester <kernel@linuxace.com> Signed-off-by: Andy Gospodarek <andy@greyhouse.net> 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.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index a93d9417dc15..66c98e61f0b7 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -4980,8 +4980,6 @@ static int bond_init(struct net_device *bond_dev)
4980 4980
4981 bond_set_lockdep_class(bond_dev); 4981 bond_set_lockdep_class(bond_dev);
4982 4982
4983 netif_carrier_off(bond_dev);
4984
4985 bond_create_proc_entry(bond); 4983 bond_create_proc_entry(bond);
4986 list_add_tail(&bond->bond_list, &bn->dev_list); 4984 list_add_tail(&bond->bond_list, &bn->dev_list);
4987 4985
@@ -5051,6 +5049,8 @@ int bond_create(struct net *net, const char *name)
5051 5049
5052 res = register_netdevice(bond_dev); 5050 res = register_netdevice(bond_dev);
5053 5051
5052 netif_carrier_off(bond_dev);
5053
5054out: 5054out:
5055 rtnl_unlock(); 5055 rtnl_unlock();
5056 if (res < 0) 5056 if (res < 0)