Commit e826eafa authored by Phil Oester's avatar Phil Oester Committed by David S. Miller

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: default avatarPhil Oester <kernel@linuxace.com>
Signed-off-by: default avatarAndy Gospodarek <andy@greyhouse.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent fd0e435b
...@@ -4980,8 +4980,6 @@ static int bond_init(struct net_device *bond_dev) ...@@ -4980,8 +4980,6 @@ static int bond_init(struct net_device *bond_dev)
bond_set_lockdep_class(bond_dev); bond_set_lockdep_class(bond_dev);
netif_carrier_off(bond_dev);
bond_create_proc_entry(bond); bond_create_proc_entry(bond);
list_add_tail(&bond->bond_list, &bn->dev_list); list_add_tail(&bond->bond_list, &bn->dev_list);
...@@ -5051,6 +5049,8 @@ int bond_create(struct net *net, const char *name) ...@@ -5051,6 +5049,8 @@ int bond_create(struct net *net, const char *name)
res = register_netdevice(bond_dev); res = register_netdevice(bond_dev);
netif_carrier_off(bond_dev);
out: out:
rtnl_unlock(); rtnl_unlock();
if (res < 0) if (res < 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment