aboutsummaryrefslogtreecommitdiff
path: root/libexec/rc/network.subr
diff options
context:
space:
mode:
authorBjoern A. Zeeb <bz@FreeBSD.org>2021-12-13 22:10:25 +0000
committerBjoern A. Zeeb <bz@FreeBSD.org>2021-12-13 22:12:44 +0000
commite448ff6f0e8035c3dd5b7bd0872f3f0d91c4e0d0 (patch)
tree52163b42b97d238dcb4af5771e94a853fd39849b /libexec/rc/network.subr
parent5c68a21697027311892481d6d615a5d6e5b47433 (diff)
downloadsrc-e448ff6f0e8035c3dd5b7bd0872f3f0d91c4e0d0.tar.gz
src-e448ff6f0e8035c3dd5b7bd0872f3f0d91c4e0d0.zip
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
Diffstat (limited to 'libexec/rc/network.subr')
-rw-r--r--libexec/rc/network.subr2
1 files changed, 1 insertions, 1 deletions
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}