From: Jun Zhao <mypopydev@gmail.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org
Subject: [patch] fix error handle in ip_mc_add_src()
Date: Mon, 21 Nov 2011 23:05:46 +0800 [thread overview]
Message-ID: <1321887946.14281.27.camel@barry.pixelworks.com> (raw)
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>
next reply other threads:[~2011-11-21 15:10 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-21 15:05 Jun Zhao [this message]
2011-11-21 15:24 ` [patch] fix error handle in ip_mc_add_src() 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
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=1321887946.14281.27.camel@barry.pixelworks.com \
--to=mypopydev@gmail.com \
--cc=davem@davemloft.net \
--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