From owner-freebsd-bugs@FreeBSD.ORG Thu Sep 10 06:10:02 2009 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 161DB1065672 for ; Thu, 10 Sep 2009 06:10:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id CCE428FC14 for ; Thu, 10 Sep 2009 06:10:01 +0000 (UTC) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n8A6A1Wk067771 for ; Thu, 10 Sep 2009 06:10:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n8A6A1bi067770; Thu, 10 Sep 2009 06:10:01 GMT (envelope-from gnats) Resent-Date: Thu, 10 Sep 2009 06:10:01 GMT Resent-Message-Id: <200909100610.n8A6A1bi067770@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Stef Walter Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 87EB9106568D for ; Thu, 10 Sep 2009 06:00:19 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id 7700A8FC21 for ; Thu, 10 Sep 2009 06:00:19 +0000 (UTC) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id n8A60JM9068946 for ; Thu, 10 Sep 2009 06:00:19 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id n8A60Ja8068945; Thu, 10 Sep 2009 06:00:19 GMT (envelope-from nobody) Message-Id: <200909100600.n8A60Ja8068945@www.freebsd.org> Date: Thu, 10 Sep 2009 06:00:19 GMT From: Stef Walter To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: kern/138691: Multicast: Keep membership and filters in sync X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Sep 2009 06:10:02 -0000 >Number: 138691 >Category: kern >Synopsis: Multicast: Keep membership and filters in sync >Confidential: no >Severity: serious >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Sep 10 06:10:01 UTC 2009 >Closed-Date: >Last-Modified: >Originator: Stef Walter >Release: 8.0-BETA4 >Organization: >Environment: FreeBSD portillo-gate.ws.local 8.0-BETA4 FreeBSD 8.0-BETA4 #10: Wed Sep 9 22:49:39 UTC 2009 root@portillo-gate.ws.local:/usr/obj/usr/src/sys/MESHNODE i386 >Description: When removing multicast membership from a socket (ie: IP_DROP_MEMBERSHIP) that has multiple multicast memberships, the internal list of memberships and filters are not kept in sync. This results in dropped packets that are not delivered to the socket that has the multicast membership. This was experienced with OSPF (running quagga). >How-To-Repeat: Besides the obvious non-functional multicast, the following command is another way to see an indication of the problem: > > # netstat -s -p ip | grep multicast > > 7 packets received for unknown multicast group >Fix: Patch attached which fixes the problem. Patch attached with submission follows: --- sys/netinet/in_mcast.c.orig 2009-09-09 19:33:22.000000000 +0000 +++ sys/netinet/in_mcast.c 2009-09-10 05:28:20.000000000 +0000 @@ -2280,7 +2292,9 @@ if (is_final) { - /* Remove the gap in the membership array. */ - for (++idx; idx < imo->imo_num_memberships; ++idx) + /* Remove the gap in the membership and filter array. */ + for (++idx; idx < imo->imo_num_memberships; ++idx) { imo->imo_membership[idx-1] = imo->imo_membership[idx]; + imo->imo_mfilters[idx-1] = imo->imo_mfilters[idx]; + } imo->imo_num_memberships--; } >Release-Note: >Audit-Trail: >Unformatted: