summaryrefslogtreecommitdiffstats
path: root/etc/network.subr
diff options
context:
space:
mode:
authorbrooks <brooks@FreeBSD.org>2005-06-30 05:02:34 +0000
committerbrooks <brooks@FreeBSD.org>2005-06-30 05:02:34 +0000
commitc724d1075b9ee7060457aa12deff7f30654ce103 (patch)
tree4f274282830b8d087da9ad0c55a9ecd4e0ca1a89 /etc/network.subr
parenta4a984e930d5fde871f064cbd9b8cf676fe8800c (diff)
downloadFreeBSD-src-c724d1075b9ee7060457aa12deff7f30654ce103.zip
FreeBSD-src-c724d1075b9ee7060457aa12deff7f30654ce103.tar.gz
- Remove the pccard_ifconfig variable in favor of a new
ifconfig_DEFAULT variable. Unlike pccard_ifconfig, ifconfig_DEFAULT applies to all interfaces that do not specify an ifconfig_<ifn> variable rather than just those listed in removable_interfaces. - Correct the list of interfaces when network_interfaces and removable_interfaces are both set by including removable_interfaces in the list of canidates. - When listing dhcp interfaces, include those with other ifconfig options so nat works. Approved by: re (network interface startup blanket)
Diffstat (limited to 'etc/network.subr')
-rw-r--r--etc/network.subr41
1 files changed, 7 insertions, 34 deletions
diff --git a/etc/network.subr b/etc/network.subr
index b05635a..b54cdbb 100644
--- a/etc/network.subr
+++ b/etc/network.subr
@@ -113,16 +113,11 @@ _ifconfig_getargs()
fi
eval _args=\$ifconfig_$1
- if [ -z "$_args" -a -n "${pccard_ifconfig}" ]; then
- for _if in ${removable_interfaces} ; do
- if [ "$_if" = "$_ifn" ] ; then
- _args=${pccard_ifconfig}
- break
- fi
- done
+ if [ -z "$_args" ]; then
+ _args=$ifconfig_DEFAULT
fi
- echo $_args
+ echo "$_args"
}
# ifconfig_getargs if
@@ -394,7 +389,7 @@ list_net_interfaces()
_tmplist="`ifconfig -l`"
;;
*)
- _tmplist="${network_interfaces} ${cloned_interfaces}"
+ _tmplist="${network_interfaces} ${removable_interfaces} ${cloned_interfaces}"
;;
esac
@@ -408,37 +403,15 @@ list_net_interfaces()
_aprefix=
_bprefix=
for _if in ${_tmplist} ; do
- eval _ifarg="\$ifconfig_${_if}"
- case "$_ifarg" in
- [Dd][Hh][Cc][Pp])
+ if dhcpif $_if; then
_dhcplist="${_dhcplist}${_aprefix}${_if}"
[ -z "$_aprefix" ] && _aprefix=' '
- ;;
- ''|*)
+ elif [ -n "`_ifconfig_getargs $if`" ]; then
_nodhcplist="${_nodhcplist}${_bprefix}${_if}"
[ -z "$_bprefix" ] && _bprefix=' '
- ;;
- esac
+ fi
done
- case ${pccard_ifconfig} in
- [Dd][Hh][Cc][Pp])
- for _if in ${removable_interfaces} ; do
- _test_if=`ifconfig ${_if} 2>&1`
- case "$_test_if" in
- "ifconfig: interface $_if does not exist")
- ;;
- *)
- _dhcplist="${_dhcplist}${_aprefix}${_if}"
- [ -z "$_aprefix" ] && _aprefix=' '
- ;;
- esac
- done
- ;;
- *)
- ;;
- esac
-
case "$type" in
nodhcp)
echo $_nodhcplist
OpenPOWER on IntegriCloud