diff options
author | Beniamino Galvani <bgalvani@redhat.com> | 2016-07-13 19:25:08 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-07-15 02:17:43 +0300 |
commit | 005db31d5f5f7c31cfdc43505d77eb3ca5cf8ec6 (patch) | |
tree | 9f6d3f1552dc75a0dacac6afc3e9ef15876454ac | |
parent | 790e5ef59fead625858919da20b3db0242db0d8d (diff) | |
download | linux-005db31d5f5f7c31cfdc43505d77eb3ca5cf8ec6.tar.xz |
bonding: set carrier off for devices created through netlink
Commit e826eafa65c6 ("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>
-rw-r--r-- | drivers/net/bonding/bond_netlink.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/net/bonding/bond_netlink.c b/drivers/net/bonding/bond_netlink.c index db760e84119f..b8df0f5e8c25 100644 --- a/drivers/net/bonding/bond_netlink.c +++ b/drivers/net/bonding/bond_netlink.c @@ -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) |