From owner-cvs-all@FreeBSD.ORG Tue Apr 24 06:38:06 2007 Return-Path: X-Original-To: cvs-all@FreeBSD.org Delivered-To: cvs-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 51A4F16A401; Tue, 24 Apr 2007 06:38:06 +0000 (UTC) (envelope-from bms@incunabulum.net) Received: from out4.smtp.messagingengine.com (out4.smtp.messagingengine.com [66.111.4.28]) by mx1.freebsd.org (Postfix) with ESMTP id 11FD913C484; Tue, 24 Apr 2007 06:38:06 +0000 (UTC) (envelope-from bms@incunabulum.net) Received: from compute1.internal (compute1.internal [10.202.2.41]) by out1.messagingengine.com (Postfix) with ESMTP id 534EE21856F; Tue, 24 Apr 2007 02:22:59 -0400 (EDT) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute1.internal (MEProxy); Tue, 24 Apr 2007 02:22:51 -0400 X-Sasl-enc: KhdhhwCrEmkb5X/Uc8Rzz0PU3Cs7AUkNB9EXalwzV2IJ 1177395771 Received: from [192.168.123.18] (82-35-112-254.cable.ubr07.dals.blueyonder.co.uk [82.35.112.254]) by mail.messagingengine.com (Postfix) with ESMTP id EFB1D19D58; Tue, 24 Apr 2007 02:22:50 -0400 (EDT) Message-ID: <462DA234.9070000@incunabulum.net> Date: Tue, 24 Apr 2007 07:22:44 +0100 From: "Bruce M. Simpson" User-Agent: Thunderbird 1.5.0.10 (Windows/20070221) MIME-Version: 1.0 To: Robert Watson References: <200704140101.l3E11kum000736@repoman.freebsd.org> <20070423095356.GB2742@FreeBSD.org> <462C8FFB.7030309@FreeBSD.org> <20070423123711.I26224@fledge.watson.org> In-Reply-To: <20070423123711.I26224@fledge.watson.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: cvs-src@FreeBSD.org, Gleb Smirnoff , "Bruce M. Simpson" , cvs-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: cvs commit: src/sys/contrib/pf/net if_pfsync.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2007 06:38:06 -0000 Robert Watson wrote: > Part of the issue here is that kernel consumers aren't the only > sources of multicast address registrations -- for example, user > applications can register them directly using ioctls. Kernel > consumers should be given every opportunity to unregister addresses > themselves (via event handlers on tear-down) before they are ripped > out, but if they're still there when it comes time to free the > interface, the stack should clean them up. The code as it currently stands mostly captures these semantics. Userland can only join IPv4 groups on a socket, therefore those allocations are already tracked, and garbage collected with the socket. For link layer groups, userland may currently join only once, because there is no other way of tracking multiple allocations -- the socket ioctl used for this can't return an opaque handle without changing the ABI. This is a rarely used feature, so this change in semantics seems OK. The code Glebius is referring to is a case where the event handler, used to detect that the member interface of a pfsync instance was detached from the rest of the system, runs only after netinet itself has been detached from the interface, but just before the interface is actually removed. Therefore, netinet has already cleaned up after itself and freed the pfsync group memberships, the detach handler need do nothing. If we made the attachment and detachment of protocol domains explicit in the network stack, then the whole would be cleaner. However, this would be a very wide ranging architectural change, far more so than the introduction of reference counting to in_multi. Regards, BMS