Skip to contentSkip to conversation

ipv4 : igmp : fix error handle in ip_mc_add_src()

PATCH Applied Jun Zhao 2 participants 2 messages Nov 23, 2011

Subsystems (3)
lore
Share & tools
lore

Jun Zhao

author
#0 lore raw

PATCH v3 1/1 ipv4 : igmp : fix error handle in ip_mc_add_src()

from: Jun Zhao <[email protected]>

When add sources to interface failure, need to roll back the sfcount[MODE] to before state. We need to match it corresponding.

---
 net/ipv4/igmp.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
net/ipv4/igmp.c +2 -1
index c7472ef..b2ca095 100644
@@ -1716,7 +1716,8 @@ static int ip_mc_add_src(struct in_device *in_dev, __be32 *pmca, int sfmode,
 	if (err) {
 		int j;
 
-		pmc->sfcount[sfmode]--;
+		if (!delta)
+			pmc->sfcount[sfmode]--;
 		for (j=0; j<i; j++)
 			(void) ip_mc_del1_src(pmc, sfmode, &psfsrc[j]);
 	} else if (isexclude != (pmc->sfcount[MCAST_EXCLUDE] != 0)) {
Signature · 1 line
1.7.2.5