- 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.
This commit is contained in:
Brooks Davis 2005-09-02 17:11:13 +00:00
parent 1f1525c556
commit 2b32284f18
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=149726

View File

@ -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}"