From owner-cvs-all@FreeBSD.ORG Tue Oct 19 17:58:10 2004 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3182216A4D0 for ; Tue, 19 Oct 2004 17:58:10 +0000 (GMT) Received: from mail5.speakeasy.net (mail5.speakeasy.net [216.254.0.205]) by mx1.FreeBSD.org (Postfix) with ESMTP id DFEDE43D73 for ; Tue, 19 Oct 2004 17:58:09 +0000 (GMT) (envelope-from jmg@hydrogen.funkthat.com) Received: (qmail 1591 invoked from network); 19 Oct 2004 17:58:09 -0000 Received: from gate.funkthat.com (HELO hydrogen.funkthat.com) ([69.17.45.168]) (envelope-sender ) by mail5.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 19 Oct 2004 17:58:09 -0000 Received: from hydrogen.funkthat.com (wdixgp@localhost.funkthat.com [127.0.0.1])i9JHw8lb068197; Tue, 19 Oct 2004 10:58:08 -0700 (PDT) (envelope-from jmg@hydrogen.funkthat.com) Received: (from jmg@localhost) by hydrogen.funkthat.com (8.12.10/8.12.10/Submit) id i9JHw7xe068196; Tue, 19 Oct 2004 10:58:07 -0700 (PDT) Date: Tue, 19 Oct 2004 10:58:07 -0700 From: John-Mark Gurney To: Andre Oppermann Message-ID: <20041019175807.GM22681@funkthat.com> References: <200410191513.i9JFDUbf072176@repoman.freebsd.org> <417532A2.9000901@errno.com> <41753522.1E39FEAE@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <41753522.1E39FEAE@freebsd.org> User-Agent: Mutt/1.4.1i X-Operating-System: FreeBSD 4.2-RELEASE i386 X-PGP-Fingerprint: B7 EC EF F8 AE ED A7 31 96 7A 22 B3 D8 56 36 F4 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html cc: Sam Leffler cc: src-committers@freebsd.org cc: cvs-all@freebsd.org cc: cvs-src@freebsd.org Subject: Re: cvs commit: src/sys/sys protosw.h src/sys/kern uipc_domain.cuipc_socket2.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: John-Mark Gurney List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Oct 2004 17:58:10 -0000 Andre Oppermann wrote this message on Tue, Oct 19, 2004 at 17:39 +0200: > > > Modified files: > > > sys/sys protosw.h > > > sys/kern uipc_domain.c uipc_socket2.c > > > Log: > > > Support for dynamically loadable and unloadable protocols within existing protocol > > > families. > > > > > > > I don't recall seeing this posted anywhere for comment. I have some > > concerns about this general topic and this code seems incomplete (e.g. I > > see no locking). > > Locking is not needed because there are no dead moments in transitioning > from unregistered to registered and back. All calls to any of the protocol > specific functions will return a valid result (even if it is only EOPNOTSUPP). > There is no list manipulation going on. > > The caller of the function is required to assure that no dangeling sockets, > references or memory allocations are left behind after unregistering. It's > simply impossible to solve otherwise. For IPDIVERT which I have converted > this works very well (it will simply refuse to unload if a divert socket is > open). > > What remaining concerns do you have? I don't see any GIANT_REQUIRE, or locking around adding a new protocol.. This means there could be a race where two modules loading a protocol get assigned the same slot... I had to do this with the kqueue subsystem when dynamicly loading filters.. -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not."