Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 25e4030

Browse files
nikolay@redhat.comdavem330
authored andcommitted
bonding: mc addresses don't get deleted on enslave failure
Add bond_mc_list_flush() after err_detach as that's the first error path after the addresses are added. The main issue is the mc addresses' refcount which only gets bumped up. v2: update log message and don't move code unnecessarily Signed-off-by: Nikolay Aleksandrov <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent cb95ec6 commit 25e4030

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/net/bonding/bond_main.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1901,6 +1901,11 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
19011901
bond_destroy_slave_symlinks(bond_dev, slave_dev);
19021902

19031903
err_detach:
1904+
if (!USES_PRIMARY(bond->params.mode)) {
1905+
netif_addr_lock_bh(bond_dev);
1906+
bond_mc_list_flush(bond_dev, slave_dev);
1907+
netif_addr_unlock_bh(bond_dev);
1908+
}
19041909
write_lock_bh(&bond->lock);
19051910
bond_detach_slave(bond, new_slave);
19061911
write_unlock_bh(&bond->lock);

0 commit comments

Comments
 (0)