From owner-svn-src-stable@FreeBSD.ORG Fri May 21 16:17:46 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9DE9E1065670; Fri, 21 May 2010 16:17:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8CCF58FC1E; Fri, 21 May 2010 16:17:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4LGHkok066317; Fri, 21 May 2010 16:17:46 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4LGHkNK066315; Fri, 21 May 2010 16:17:46 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201005211617.o4LGHkNK066315@svn.freebsd.org> From: John Baldwin Date: Fri, 21 May 2010 16:17:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208385 - stable/7/etc X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 May 2010 16:17:46 -0000 Author: jhb Date: Fri May 21 16:17:46 2010 New Revision: 208385 URL: http://svn.freebsd.org/changeset/base/208385 Log: MFC 208213: Prevent unloading a kld for a driver that has subinterfaces (vlan interfaces) from being automatically reloaded via devd shutdown event handlers. - Revert part of my previous changes to call ifn_stop on subinterfaces when an interface is detached. It is better to destroy the interfaces first so that an 'ifconfig foo0.blah down' doesn't result in ifconfig auto-loading if_foo.ko. The ifconfig command will not be invoked if foo0.blah is gone when ifn_stop() is called. Furthermore, it is not necessary to explicitly invoke ifn_stop() after the subinterface is destroyed as devd will already do that. - Pass -n to ifconfig when destroying interfaces so that destroying a cloned interface does not kldload any drivers. Modified: stable/7/etc/network.subr Directory Properties: stable/7/etc/ (props changed) Modified: stable/7/etc/network.subr ============================================================================== --- stable/7/etc/network.subr Fri May 21 16:17:08 2010 (r208384) +++ stable/7/etc/network.subr Fri May 21 16:17:46 2010 (r208385) @@ -485,7 +485,7 @@ clone_down() _prefix= _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=' ' @@ -549,10 +549,7 @@ childif_destroy() if ! ifexists $child; then continue fi - if autoif $child; then - ifn_stop $child - fi - ifconfig $child destroy && cfg=0 + ifconfig -n $child destroy && cfg=0 done return ${cfg}