From owner-freebsd-net@FreeBSD.ORG Wed Jul 19 13:09:52 2006 Return-Path: X-Original-To: freebsd-net@freebsd.org Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 28F1516A4DE for ; Wed, 19 Jul 2006 13:09:52 +0000 (UTC) (envelope-from gnn@neville-neil.com) Received: from outbound0.sv.meer.net (outbound0.mx.meer.net [209.157.153.23]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0315E43D5F for ; Wed, 19 Jul 2006 13:09:48 +0000 (GMT) (envelope-from gnn@neville-neil.com) Received: from mail.meer.net (mail.meer.net [209.157.152.14]) by outbound0.sv.meer.net (8.12.10/8.12.6) with ESMTP id k6JD9mik026884; Wed, 19 Jul 2006 06:09:48 -0700 (PDT) (envelope-from gnn@neville-neil.com) Received: from minion.local.neville-neil.com (61.204.211.246.customerlink.pwd.ne.jp [61.204.211.246]) by mail.meer.net (8.13.3/8.13.3/meer) with ESMTP id k6JD9d88006348; Wed, 19 Jul 2006 06:09:39 -0700 (PDT) (envelope-from gnn@neville-neil.com) Date: Wed, 19 Jul 2006 22:09:36 +0900 Message-ID: From: gnn@freebsd.org To: "Tom Parker" In-Reply-To: <9050f13e0607181203r610da712kc506507b4f90b77c@mail.gmail.com> References: <9050f13e0607181203r610da712kc506507b4f90b77c@mail.gmail.com> User-Agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (=?ISO-8859-4?Q?Shij=F2?=) APEL/10.6 Emacs/22.0.50 (i386-apple-darwin8.6.1) MULE/5.0 (SAKAKI) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Cc: freebsd-net@freebsd.org Subject: Re: Possible inconsistency in the use of in6_delmulti() X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jul 2006 13:09:52 -0000 At Tue, 18 Jul 2006 12:03:20 -0700, Tom Parker wrote: > > Hi, > > New to the list here, but fairly familiar with the innards of (at > least an older) version of the fbsd networking code. I'm fortunate in > my ability to run purify on a simulated instance of our ported version > of the networking code. Purify has picked up a problem that I'm a bit > mystified as how it can be fixed. It is present in current versions > also, I'm interested in any comments people have (I think ours is 4.4 > vintage, but it is hard to tell). > > As far as I can tell, in most calling paths when in6_delmulti() is > called, it is done after the in6_multi_mship structure has been > removed from the im6o_memberships list in the relevant PCB. This > applies to in6_ifdetach(), in6_pcbpurgeif0, ip6_setmoptions() etc. > However in in6_purgeaddr() in6_delmulti is called straight off. I'm > not sure if we've violated some usage convention, but purify is > telling me this causes access violations when we then leave the same > group using setsockopt(). in6_purgeaddr is called when we remove the > address from the interface. > > This should be possible in a real kernel. Add a multicast address to > an interface, open a socket and listen to the address, then remove the > address from the interface. > > Am I missing something here or is this a nasty problem in both the > kernel and our stack port? > It sounds like a bug to me. Can you file a PR? Thanks, George