summaryrefslogtreecommitdiffstats
path: root/etc/network.subr
diff options
context:
space:
mode:
authorbrooks <brooks@FreeBSD.org>2005-09-02 17:11:13 +0000
committerbrooks <brooks@FreeBSD.org>2005-09-02 17:11:13 +0000
commit7d67985300c2c4436142f24d31bb457ea524a4fc (patch)
tree3a5aad2b1273398f1df787305cdcfa3c7cc626a3 /etc/network.subr
parent1b74cef931999b2593e67c11e9197f05b3293ac1 (diff)
downloadFreeBSD-src-7d67985300c2c4436142f24d31bb457ea524a4fc.zip
FreeBSD-src-7d67985300c2c4436142f24d31bb457ea524a4fc.tar.gz
- Alwasy explicitly bring the interface up before configuring it.
- If an interface's ifconfig_<ifn> is set, but empty, don't set it to ifconfig_DEFAULT. This way interfaces can be disabled even in the presence of ifconfig_DEFAULT. - When listing interfaces and network_interfaces=auto, place lo0 first if it's around.
Diffstat (limited to 'etc/network.subr')
-rw-r--r--etc/network.subr24
1 files changed, 17 insertions, 7 deletions
diff --git a/etc/network.subr b/etc/network.subr
index 1ec62d4..d5a1703 100644
--- a/etc/network.subr
+++ b/etc/network.subr
@@ -43,16 +43,23 @@ ifconfig_up()
ifconfig_args=`ifconfig_getargs $1`
if [ -n "${ifconfig_args}" ]; then
+ ifconfig $1 up
eval "ifconfig $1 ${ifconfig_args}"
_cfg=0
fi
if wpaif $1; then
+ if [ $_cfg -ne 0 ] ; then
+ ifconfig $1 up
+ fi
/etc/rc.d/wpa_supplicant start $1
_cfg=0 # XXX: not sure this should count
fi
if dhcpif $1; then
+ if [ $_cfg -ne 0 ] ; then
+ ifconfig $1 up
+ fi
/etc/rc.d/dhclient start $1
_cfg=0
fi
@@ -112,10 +119,7 @@ _ifconfig_getargs()
return 1
fi
- eval _args=\$ifconfig_$1
- if [ -z "$_args" ]; then
- _args=$ifconfig_DEFAULT
- fi
+ eval _args=\${ifconfig_$1-$ifconfig_DEFAULT}
echo "$_args"
}
@@ -400,18 +404,24 @@ list_net_interfaces()
{
type=$1
- # Get a list of ALL the interfaces
+ # Get a list of ALL the interfaces and make lo0 first if it's there.
#
case ${network_interfaces} in
[Aa][Uu][Tt][Oo])
_prefix=''
_autolist="`ifconfig -l`"
+ _lo=
for _if in ${_autolist} ; do
if autoif $_if; then
- _tmplist="${_tmplist}${_prefix}${_if}"
- [ -z "$_prefix" ] && _prefix=' '
+ if [ "$_if" = "lo0" ]; then
+ _lo="lo0 "
+ else
+ _tmplist="${_tmplist}${_prefix}${_if}"
+ [ -z "$_prefix" ] && _prefix=' '
+ fi
fi
done
+ _tmplist="${_lo}${_tmplist}"
;;
*)
_tmplist="${network_interfaces} ${cloned_interfaces}"
OpenPOWER on IntegriCloud