Skip to content

Commit

Permalink
bonding: Call netif_carrier_off after register_netdevice
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Phil Oester authored and davem330 committed Mar 16, 2011
1 parent fd0e435 commit e826eaf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/bonding/bond_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -4980,8 +4980,6 @@ static int bond_init(struct net_device *bond_dev)

bond_set_lockdep_class(bond_dev);

netif_carrier_off(bond_dev);

bond_create_proc_entry(bond);
list_add_tail(&bond->bond_list, &bn->dev_list);

Expand Down Expand Up @@ -5051,6 +5049,8 @@ int bond_create(struct net *net, const char *name)

res = register_netdevice(bond_dev);

netif_carrier_off(bond_dev);

out:
rtnl_unlock();
if (res < 0)
Expand Down

0 comments on commit e826eaf

Please sign in to comment.