bonding: mc addresses don't get deleted on enslave failure
authornikolay@redhat.com <nikolay@redhat.com>
Thu, 18 Apr 2013 07:33:34 +0000 (07:33 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 19 Apr 2013 21:48:18 +0000 (17:48 -0400)
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 <nikolay@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/bonding/bond_main.c

index dea8ce20fea470cb9c95528eec6fa45c82b39198..4cecb80df854524d5781760050b352dd5c70e61b 100644 (file)
@@ -1901,6 +1901,11 @@ err_dest_symlinks:
        bond_destroy_slave_symlinks(bond_dev, slave_dev);
 
 err_detach:
+       if (!USES_PRIMARY(bond->params.mode)) {
+               netif_addr_lock_bh(bond_dev);
+               bond_mc_list_flush(bond_dev, slave_dev);
+               netif_addr_unlock_bh(bond_dev);
+       }
        write_lock_bh(&bond->lock);
        bond_detach_slave(bond, new_slave);
        write_unlock_bh(&bond->lock);