Date: Fri, 21 May 2010 16:17:08 +0000 (UTC) From: John Baldwin <jhb@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r208384 - stable/8/etc Message-ID: <201005211617.o4LGH8fK066151@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jhb Date: Fri May 21 16:17:08 2010 New Revision: 208384 URL: http://svn.freebsd.org/changeset/base/208384 Log: MFC 208213: Prevent unloading a kld for a driver that has subinterfaces (vlan and/or wlan 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/8/etc/network.subr Directory Properties: stable/8/etc/ (props changed) Modified: stable/8/etc/network.subr ============================================================================== --- stable/8/etc/network.subr Fri May 21 16:07:41 2010 (r208383) +++ stable/8/etc/network.subr Fri May 21 16:17:08 2010 (r208384) @@ -516,7 +516,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=' ' @@ -599,10 +599,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 child_vlans=`get_if_var $ifn vlans_IF` @@ -613,10 +610,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}
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201005211617.o4LGH8fK066151>