From patchwork Sun May 15 16:59:45 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Veaceslav Falico X-Patchwork-Id: 786302 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.3) with ESMTP id p4FH0Y6R018244 for ; Sun, 15 May 2011 17:00:35 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755119Ab1EORAd (ORCPT ); Sun, 15 May 2011 13:00:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:11697 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751212Ab1EORAc (ORCPT ); Sun, 15 May 2011 13:00:32 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p4FGxpfP029883 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 15 May 2011 12:59:51 -0400 Received: from darkmag.usersys.redhat.com (dhcp-1-250.brq.redhat.com [10.34.1.250]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p4FGxkrv013948 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Sun, 15 May 2011 12:59:49 -0400 Date: Sun, 15 May 2011 18:59:45 +0200 From: Veaceslav Falico To: "David S. Miller" Cc: Michal Marek , Alexey Kuznetsov , "Pekka Savola (ipv6)" , James Morris , Hideaki YOSHIFUJI , Patrick McHardy , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH 1/1] igmp: fix ip_mc_clear_src to not reset ip_mc_list->sf{mode,count} Message-ID: <20110515165945.GA20024@darkmag.usersys.redhat.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Sun, 15 May 2011 17:00:35 +0000 (UTC) ip_mc_clear_src resets the imc->sfcount and imc->sfmode, without taking into account the current number of sockets listening on that multicast struct, which can lead to bogus routes for local listeners. On NETDEV_DOWN/UP event, if there were 3 multicast listeners for that interface's address, the imc->sfcount[MCAST_EXCLUDE] will be reset to 1. And after that a listener socket destroys, multicast traffic will not be delivered to local listeners because __mkroute_output drops the local flag for the route (by checking ip_check_mc). Signed-off-by: Veaceslav Falico --- To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c index 1fd3d9c..b14f371 100644 --- a/net/ipv4/igmp.c +++ b/net/ipv4/igmp.c @@ -1775,9 +1775,6 @@ static void ip_mc_clear_src(struct ip_mc_list *pmc) kfree(psf); } pmc->sources = NULL; - pmc->sfmode = MCAST_EXCLUDE; - pmc->sfcount[MCAST_INCLUDE] = 0; - pmc->sfcount[MCAST_EXCLUDE] = 1; }