bonding: set carrier off for devices created through netlink
authorBeniamino Galvani <bgalvani@redhat.com>
Wed, 13 Jul 2016 16:25:08 +0000 (18:25 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 14 Jul 2016 23:17:43 +0000 (16:17 -0700)
commit005db31d5f5f7c31cfdc43505d77eb3ca5cf8ec6
tree9f6d3f1552dc75a0dacac6afc3e9ef15876454ac
parent790e5ef59fead625858919da20b3db0242db0d8d
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>
drivers/net/bonding/bond_netlink.c