linux/drivers/net/bonding
Zhang Changzhong a6ab75cec1 bonding: force carrier update when releasing slave
In __bond_release_one(), bond_set_carrier() is only called when bond
device has no slave. Therefore, if we remove the up slave from a master
with two slaves and keep the down slave, the master will remain up.

Fix this by moving bond_set_carrier() out of if (!bond_has_slaves(bond))
statement.

Reproducer:
$ insmod bonding.ko mode=0 miimon=100 max_bonds=2
$ ifconfig bond0 up
$ ifenslave bond0 eth0 eth1
$ ifconfig eth0 down
$ ifenslave -d bond0 eth1
$ cat /proc/net/bonding/bond0

Fixes: ff59c4563a ("[PATCH] bonding: support carrier state for master")
Signed-off-by: Zhang Changzhong <zhangchangzhong@huawei.com>
Acked-by: Jay Vosburgh <jay.vosburgh@canonical.com>
Link: https://lore.kernel.org/r/1645021088-38370-1-git-send-email-zhangchangzhong@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2022-02-17 10:55:21 -08:00
..
bond_3ad.c bonding: fix data-races around agg_select_timer 2022-02-15 14:35:18 +00:00
bond_alb.c bonding: make tx_rebalance_counter an atomic 2021-12-03 14:16:48 +00:00
bond_debugfs.c net: bonding: remove unnecessary braces 2021-05-20 15:43:24 -07:00
bond_main.c bonding: force carrier update when releasing slave 2022-02-17 10:55:21 -08:00
bond_netlink.c Bonding: add arp_missed_max option 2021-11-30 12:15:58 +00:00
bond_options.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-12-23 16:09:58 -08:00
bond_procfs.c proc: remove PDE_DATA() completely 2022-01-22 08:33:37 +02:00
bond_sysfs_slave.c bonding: Fix a use-after-free problem when bond_sysfs_slave_add() failed 2021-11-05 10:14:38 +00:00
bond_sysfs.c Bonding: add arp_missed_max option 2021-11-30 12:15:58 +00:00
bonding_priv.h drivers: Remove inclusion of vermagic header 2020-04-21 13:27:37 -07:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00