Skip to content

Commit

Permalink
bonding: set carrier off for devices created through netlink
Browse files Browse the repository at this point in the history
Commit e826eaf ("bonding: Call netif_carrier_off after
register_netdevice") moved netif_carrier_off() from bond_init() to
bond_create(), but the latter is called only for initial default
devices and ones created through sysfs:

 $ modprobe bonding
 $ echo +bond1 > /sys/class/net/bonding_masters
 $ ip link add bond2 type bond
 $ grep "MII Status" /proc/net/bonding/*
 /proc/net/bonding/bond0:MII Status: down
 /proc/net/bonding/bond1:MII Status: down
 /proc/net/bonding/bond2:MII Status: up

Ensure that carrier is initially off also for devices created through
netlink.

Signed-off-by: Beniamino Galvani <bgalvani@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Beniamino Galvani authored and David S. Miller committed Jul 14, 2016
1 parent 790e5ef commit 005db31
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/net/bonding/bond_netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,11 @@ static int bond_newlink(struct net *src_net, struct net_device *bond_dev,
if (err < 0)
return err;

return register_netdevice(bond_dev);
err = register_netdevice(bond_dev);

netif_carrier_off(bond_dev);

return err;
}

static size_t bond_get_size(const struct net_device *bond_dev)
Expand Down

0 comments on commit 005db31

Please sign in to comment.