netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jun Zhao <mypopydev@gmail.com>
To: davem@davemloft.net
Cc: Eric Dumazet <eric.dumazet@gmail.com>,
	netdev@vger.kernel.org, David Stevens <dlstevens@us.ibm.com>
Subject: [patch v2 1/1] fix error handle in ip_mc_add_src()
Date: Tue, 22 Nov 2011 00:05:16 +0800	[thread overview]
Message-ID: <1321891516.14281.62.camel@barry.pixelworks.com> (raw)

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)) {

             reply	other threads:[~2011-11-21 16:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-21 16:05 Jun Zhao [this message]
2011-11-22 21:22 ` [patch v2 1/1] fix error handle in ip_mc_add_src() David Miller
2011-11-22 23:08   ` Jun Zhao
2011-11-23  8:25 ` ShanWei
2011-11-23  9:04   ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1321891516.14281.62.camel@barry.pixelworks.com \
    --to=mypopydev@gmail.com \
    --cc=davem@davemloft.net \
    --cc=dlstevens@us.ibm.com \
    --cc=eric.dumazet@gmail.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).