From owner-freebsd-net@FreeBSD.ORG Mon May 3 23:37:35 2010 Return-Path: Delivered-To: net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A3EA51065676 for ; Mon, 3 May 2010 23:37:35 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx22.fluidhosting.com [204.14.89.5]) by mx1.freebsd.org (Postfix) with ESMTP id 3AFD48FC0A for ; Mon, 3 May 2010 23:37:33 +0000 (UTC) Received: (qmail 12637 invoked by uid 399); 3 May 2010 23:37:33 -0000 Received: from localhost (HELO foreign.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 3 May 2010 23:37:33 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4BDF5E3C.4080301@FreeBSD.org> Date: Mon, 03 May 2010 16:37:32 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.1.9) Gecko/20100330 Thunderbird/3.0.4 MIME-Version: 1.0 To: John Baldwin References: <201005031527.18468.jhb@freebsd.org> In-Reply-To: <201005031527.18468.jhb@freebsd.org> X-Enigmail-Version: 1.0.1 OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Brooks Davis , freebsd-rc@FreeBSD.org, net@freebsd.org Subject: Re: Workaround automatic re-loading of network drivers 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: Mon, 03 May 2010 23:37:35 -0000 Seems reasonable to me. Doug On 05/03/10 12:27, John Baldwin wrote: > While testing some changes with vlans and the new vlan_ syntax in rc.conf > I've noticed the following behavior: > > ifconfig foo0.100 destroy > > Will actually try to kldload the 'foo' driver. This can prove very non- > intuitive. In general I think we shouldn't try to kldload anything when > destroying an interface period. What I've done locally is to pass '-n' to > ifconfig when destroying an interface. > > We should possibly fix some other bugs however. For example, ifmaybeload() in > ifconfig should probably stop at the first non-digit it finds (e.g. ".") > rather than trimming from the first digit on. Also, perhaps 'ifconfig > destroy' should imply -n without requiring it to be explicit. > > I also moved the ifconfig destroy of wlan and vlan devices up before running > ifn_stop to prevent running 'ifconfig down' which would also reload the > driver due to the first bug in ifconfig. > > Index: network.subr > =================================================================== > --- network.subr (revision 207329) > +++ network.subr (working copy) > @@ -915,7 +915,7 @@ > _list= > > for ifn in ${cloned_interfaces}; do > - ifconfig ${ifn} destroy > + ifconfig -n ${ifn} destroy > if [ $? -eq 0 ]; then > _list="${_list}${_prefix}${ifn}" > [ -z "$_prefix" ] && _prefix=' ' > @@ -1000,10 +1000,10 @@ > if ! ifexists $child; then > continue > fi > + ifconfig -n $child destroy && cfg=0 > if autoif $child; then > ifn_stop $child > fi > - ifconfig $child destroy && cfg=0 > done > > child_vlans=`get_if_var $ifn vlans_IF` > @@ -1014,10 +1014,10 @@ > if ! ifexists $child; then > continue > fi > + ifconfig -n $child destroy && cfg=0 > if autoif $child; then > ifn_stop $child > fi > - ifconfig $child destroy && cfg=0 > done > > return ${cfg} > > -- ... and that's just a little bit of history repeating. -- Propellerheads Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/