rc: network.subr improve network6_getladdr()

In network6_getladdr() we are iterating over inet6 lines and are not
interested in any others.  So tell ifconfig to limit output to "inet6"
as much as possible.
This is probably a micro-optimisation but was noticed while looking
at other IPv6-related boot-time improvements.

MFC after:	1 week
This commit is contained in:
Bjoern A. Zeeb 2021-12-13 22:10:25 +00:00
parent 5c68a21697
commit e448ff6f0e

View File

@ -1746,7 +1746,7 @@ network6_getladdr()
_if=$1
_flag=$2
${IFCONFIG_CMD} $_if 2>/dev/null | while read proto addr rest; do
${IFCONFIG_CMD} $_if inet6 2>/dev/null | while read proto addr rest; do
case "${proto}/${addr}/${_flag}/${rest}" in
inet6/fe80::*//*)
echo ${addr}