mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-10 12:57:06 +09:00
bonding: process the err returned by dev_set_allmulti properly in bond_enslave
[ Upstream commit9f5a90c107] When dev_set_promiscuity(1) succeeds but dev_set_allmulti(1) fails, dev_set_promiscuity(-1) should be done before going to the err path. Otherwise, dev->promiscuity will leak. Fixes:7e1a1ac1fb("bonding: Check return of dev_set_promiscuity/allmulti") Signed-off-by: Xin Long <lucien.xin@gmail.com> Acked-by: Andy Gospodarek <andy@greyhouse.net> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
d6d65b4c8f
commit
359d6e3578
@@ -1700,8 +1700,11 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
|
||||
/* set allmulti level to new slave */
|
||||
if (bond_dev->flags & IFF_ALLMULTI) {
|
||||
res = dev_set_allmulti(slave_dev, 1);
|
||||
if (res)
|
||||
if (res) {
|
||||
if (bond_dev->flags & IFF_PROMISC)
|
||||
dev_set_promiscuity(slave_dev, -1);
|
||||
goto err_sysfs_del;
|
||||
}
|
||||
}
|
||||
|
||||
netif_addr_lock_bh(bond_dev);
|
||||
|
||||
Reference in New Issue
Block a user