From owner-freebsd-current@FreeBSD.ORG Sat May 12 20:20:06 2007 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DE6D816A405 for ; Sat, 12 May 2007 20:20:06 +0000 (UTC) (envelope-from thompsa@freebsd.org) Received: from heff.fud.org.nz (203-109-251-39.static.bliink.ihug.co.nz [203.109.251.39]) by mx1.freebsd.org (Postfix) with ESMTP id 76A0B13C46E for ; Sat, 12 May 2007 20:20:06 +0000 (UTC) (envelope-from thompsa@freebsd.org) Received: by heff.fud.org.nz (Postfix, from userid 1001) id D7C9D1CC5A; Sun, 13 May 2007 08:20:04 +1200 (NZST) Date: Sun, 13 May 2007 08:20:04 +1200 From: Andrew Thompson To: Fredrik Lindberg Message-ID: <20070512202004.GA71624@heff.fud.org.nz> Mail-Followup-To: Andrew Thompson , Fredrik Lindberg , freebsd-current@freebsd.org References: <4645E8A2.1040408@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4645E8A2.1040408@FreeBSD.org> User-Agent: Mutt/1.5.13 (2006-08-11) Cc: freebsd-current@freebsd.org Subject: Re: Network interface modules keeps re-loading X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 May 2007 20:20:06 -0000 On Sat, May 12, 2007 at 06:17:38PM +0200, Fredrik Lindberg wrote: > Hi > > Due to some exciting interaction between kldunload, devctl/devd, rc(8) > and ifconfig it's currently impossible to unload a network interface > module (without stopping devd first). > > The feature of having ifconfig loading modules was discussed briefly > on current@ a while ago, but apparently nothing came out of it. > > ifmaybeload() is called quite early in ifconfig, my suggestion is to > only call it if there is at least one more argument except the interface > name given on the command line. > diff -u -u -r1.130 ifconfig.c > --- ifconfig.c 24 Mar 2007 20:26:54 -0000 1.130 > +++ ifconfig.c 12 May 2007 16:13:39 -0000 > @@ -229,7 +229,8 @@ > argc--, argv++; > > /* check and maybe load support for this interface */ > - ifmaybeload(ifname); > + if (argc >= 1) > + ifmaybeload(ifname); A similar solution to this was committed in rev1.129 of ifconfig.c but then backed out later as the module loading proved to be feature used by quite a few people. I think an example was being able to load and initialise an interface by just trying 'ifconfig foo0'. I think a different way to solve this is to add a argument to ifconfig to suppress the module loading and then use it at the appropriate places in rc. Andrew