diff options
author | yar <yar@FreeBSD.org> | 2004-08-28 07:58:02 +0000 |
---|---|---|
committer | yar <yar@FreeBSD.org> | 2004-08-28 07:58:02 +0000 |
commit | 2032b765e70bf2638c33fea6437540f26aa24e2a (patch) | |
tree | 2675b1c9f8711695c31f2f0d3eca9742369f6e39 /etc | |
parent | 655e07d67c4dee13cf1de41f99a818b097c24190 (diff) | |
download | FreeBSD-src-2032b765e70bf2638c33fea6437540f26aa24e2a.zip FreeBSD-src-2032b765e70bf2638c33fea6437540f26aa24e2a.tar.gz |
Avoid double appearing of cloned interfaces in the output
from list_net_interfaces() when network_interfaces=auto.
Rationale: Since the auto case is special, the lesser evil
had to be chosen among not adding cloned interfaces to
_tmplist or removing duplicates from _tmplist after adding
cloned interfaces. Since list_net_interfaces() must not use
/usr/bin tools, the former "evil" appeared clearer and much
more efficient. (See the PR audit trail for discussion.)
PR: conf/63700
Reviewed by: brooks
MFC after: 5 days
Diffstat (limited to 'etc')
-rw-r--r-- | etc/network.subr | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/etc/network.subr b/etc/network.subr index 64cfd6f..b413e01 100644 --- a/etc/network.subr +++ b/etc/network.subr @@ -258,7 +258,9 @@ ipx_down() # nodhcp - all interfaces, excluding DHCP configured interfaces # dhcp - list only DHCP configured interfaces # If no argument is specified all network interfaces are output. -# Note that the list always includes cloned interfaces. +# Note that the list will include cloned interfaces if applicable. +# Cloned interfaces must already exist to have a chance to appear +# in the list if ${network_interfaces} is set to `auto'. # list_net_interfaces() { @@ -271,10 +273,9 @@ list_net_interfaces() _tmplist="`ifconfig -l`" ;; *) - _tmplist="${network_interfaces}" + _tmplist="${network_interfaces} ${cloned_interfaces}" ;; esac - _tmplist="${_tmplist} ${cloned_interfaces}" if [ -z "$type" ]; then echo $_tmplist |