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
This commit is contained in:
parent
655e07d67c
commit
2032b765e7
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user