public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] fix error handle in ip_mc_add_src()
@ 2011-11-21 15:05 Jun Zhao
  2011-11-21 15:24 ` Eric Dumazet
  2011-11-21 18:30 ` David Miller
  0 siblings, 2 replies; 7+ messages in thread
From: Jun Zhao @ 2011-11-21 15:05 UTC (permalink / raw)
  To: davem; +Cc: netdev

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

diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c
index c7472ef..276719a 100644
--- a/net/ipv4/igmp.c
+++ b/net/ipv4/igmp.c
@@ -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)) {

Signed-off-by: Jun Zhao <mypopydev@gmail.com>

^ permalink raw reply related	[flat|nested] 7+ messages in thread
* [patch] fix error handle in ip_mc_add_src()
@ 2011-11-21 15:51 Jun Zhao
  2011-11-21 16:00 ` Eric Dumazet
  0 siblings, 1 reply; 7+ messages in thread
From: Jun Zhao @ 2011-11-21 15:51 UTC (permalink / raw)
  To: davem; +Cc: netdev, Eric Dumazet, David Stevens

from: Jun Zhao <mypopydev@gmail.com>

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

Signed-off-by: Jun Zhao <mypopydev@gmail.com>
---
diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c
index c7472ef..b2ca095 100644
--- a/net/ipv4/igmp.c
+++ b/net/ipv4/igmp.c
@@ -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)) {

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-11-21 18:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-21 15:05 [patch] fix error handle in ip_mc_add_src() Jun Zhao
2011-11-21 15:24 ` Eric Dumazet
2011-11-21 15:30   ` Jun Zhao
2011-11-21 15:37     ` David Stevens
2011-11-21 18:30 ` David Miller
  -- strict thread matches above, loose matches on Subject: below --
2011-11-21 15:51 Jun Zhao
2011-11-21 16:00 ` Eric Dumazet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox