summaryrefslogtreecommitdiffstats
path: root/etc/network.subr
diff options
context:
space:
mode:
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