From 7e1a1ac1fbaa88fe254400b7f30b775502932ad3 Mon Sep 17 00:00:00 2001 From: Wang Chen Date: Mon, 14 Jul 2008 20:51:36 -0700 Subject: bonding: Check return of dev_set_promiscuity/allmulti dev_set_promiscuity/allmulti might overflow. Commit: "netdevice: Fix promiscuity and allmulti overflow" in net-next makes dev_set_promiscuity/allmulti return error number if overflow happened. In bond_alb and bond_main, we check all positive increment for promiscuity and allmulti to get error return. But there are still two problems left. 1. Some code path has no mechanism to signal errors upstream. 2. If there are multi slaves, it's hard to tell which slaves increment promisc/allmulti successfully and which failed. So I left these problems to be FIXME. Fortunately, the overflow is very rare case. Signed-off-by: Wang Chen Signed-off-by: David S. Miller --- drivers/net/bonding/bond_alb.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'drivers/net/bonding/bond_alb.c') diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c index 5a673725471..b211486a0ca 100644 --- a/drivers/net/bonding/bond_alb.c +++ b/drivers/net/bonding/bond_alb.c @@ -419,8 +419,10 @@ static void rlb_teach_disabled_mac_on_primary(struct bonding *bond, u8 addr[]) } if (!bond->alb_info.primary_is_promisc) { - bond->alb_info.primary_is_promisc = 1; - dev_set_promiscuity(bond->curr_active_slave->dev, 1); + if (!dev_set_promiscuity(bond->curr_active_slave->dev, 1)) + bond->alb_info.primary_is_promisc = 1; + else + bond->alb_info.primary_is_promisc = 0; } bond->alb_info.rlb_promisc_timeout_counter = 0; -- cgit v1.2.3