[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1321887946.14281.27.camel@barry.pixelworks.com>
Date: Mon, 21 Nov 2011 23:05:46 +0800
From: Jun Zhao <mypopydev@...il.com>
To: davem@...emloft.net
Cc: netdev@...r.kernel.org
Subject: [patch] fix error handle in ip_mc_add_src()
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@...il.com>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists