From e448ff6f0e8035c3dd5b7bd0872f3f0d91c4e0d0 Mon Sep 17 00:00:00 2001 From: "Bjoern A. Zeeb" Date: Mon, 13 Dec 2021 22:10:25 +0000 Subject: 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 --- libexec/rc/network.subr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libexec/rc/network.subr') diff --git a/libexec/rc/network.subr b/libexec/rc/network.subr index 808e48532a13..2475841ffb40 100644 --- a/libexec/rc/network.subr +++ b/libexec/rc/network.subr @@ -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} -- cgit v1.2.3