aboutsummaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2010-05-17 19:51:34 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2010-05-17 19:51:34 +0000
commit4d84f49da4ad95a61c7049a3a385ba884ae668c5 (patch)
tree8f14dbeb1acc03294ea6944e3ef7646731e45eec /etc
parent6f359e28288a41952592fadc29d64c3c0ed1c93d (diff)
downloadsrc-4d84f49da4ad95a61c7049a3a385ba884ae668c5.tar.gz
src-4d84f49da4ad95a61c7049a3a385ba884ae668c5.zip
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. Reviewed by: dougb MFC after: 4 days
Notes
Notes: svn path=/head/; revision=208213
Diffstat (limited to 'etc')
-rw-r--r--etc/network.subr12
1 files changed, 3 insertions, 9 deletions
diff --git a/etc/network.subr b/etc/network.subr
index 12fb8b3a61b7..21c15895ebae 100644
--- a/etc/network.subr
+++ b/etc/network.subr
@@ -917,7 +917,7 @@ clone_down()
_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=' '
@@ -1002,10 +1002,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`
@@ -1016,10 +1013,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}