From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jun Zhao Subject: [patch v2 1/1] fix error handle in ip_mc_add_src() Date: Tue, 22 Nov 2011 00:05:16 +0800 Message-ID: <1321891516.14281.62.camel@barry.pixelworks.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: Eric Dumazet , netdev@vger.kernel.org, David Stevens To: davem@davemloft.net Return-path: Received: from mail-iy0-f174.google.com ([209.85.210.174]:52006 "EHLO mail-iy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754647Ab1KUQGH (ORCPT ); Mon, 21 Nov 2011 11:06:07 -0500 Received: by iage36 with SMTP id e36so7456569iag.19 for ; Mon, 21 Nov 2011 08:06:07 -0800 (PST) Sender: netdev-owner@vger.kernel.org List-ID: from: Jun Zhao 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 Acked-by: Eric Dumazet Signed-off-by: Jun Zhao --- 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; jsfcount[MCAST_EXCLUDE] != 0)) {