netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch v2 1/1] fix error handle in ip_mc_add_src()
@ 2011-11-21 16:05 Jun Zhao
  2011-11-22 21:22 ` David Miller
  2011-11-23  8:25 ` ShanWei
  0 siblings, 2 replies; 5+ messages in thread
From: Jun Zhao @ 2011-11-21 16:05 UTC (permalink / raw)
  To: davem; +Cc: Eric Dumazet, netdev, 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. 

Acked-by: David L Stevens <dlstevens@us.ibm.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
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] 5+ messages in thread

end of thread, other threads:[~2011-11-23  9:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-21 16:05 [patch v2 1/1] fix error handle in ip_mc_add_src() Jun Zhao
2011-11-22 21:22 ` David Miller
2011-11-22 23:08   ` Jun Zhao
2011-11-23  8:25 ` ShanWei
2011-11-23  9:04   ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).