From nobody Wed Dec 29 16:03:56 2021 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 1111B191B05E; Wed, 29 Dec 2021 16:03:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JPGRc5hdRz4XSR; Wed, 29 Dec 2021 16:03:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A3715277ED; Wed, 29 Dec 2021 16:03:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1BTG3uqw028073; Wed, 29 Dec 2021 16:03:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BTG3uVm028072; Wed, 29 Dec 2021 16:03:56 GMT (envelope-from git) Date: Wed, 29 Dec 2021 16:03:56 GMT Message-Id: <202112291603.1BTG3uVm028072@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 1a305490732c - stable/13 - rc: network.subr improve network6_getladdr() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1a305490732cdd30d19627b49847ebe09009a8f7 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1640793836; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=axbm6sa1VPCt3GBWPRxy97jkQMXH+BhcMimbOlxlVhI=; b=SQ9/3dyJUBuFAezAju9Lxy4Ti+GfHaMkkZBd1rhVpUKqgZtlnF7lmk58nngglyWAZX9PwU HUmHIVEj1cuUOafYnYuAelWcTHHREbjbJ/lHkQ+Fpe9CRRHjr4HTqHZ21swc0/p4rLrqGp PlgAd5iKB18tBYq93mg6wL7zLkjQTdwnd9v2cZFj6jIJ0uqU7Gd0OaDAAIOephXkFXXWky cqzt4ehNsfuL1GkPHFxOpAe+t4F+6A/i+H55W99LbpIBOLtA4NgLo5OKLx+ivdij5k6LY4 HxNqHiT3VWZWn11j6gSbgPiSFOhGxT1rOrKq06r3ElAf4SNvRAmDvzuixxgpnw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1640793836; a=rsa-sha256; cv=none; b=HCR/ZS3r+TmnC2RHX14wWXhGzdEHooKsC53wDJz30Ldxsm1caGpohTYisv4xwpdvlfBuVq 7bCbF+aNmeJmaYacW1rynUiKhlufYpHfZ7nAH9URSDwEcjKgaR+gqm/t9V8NPSsM+9iNqB XdrsV0XhTP6QiwNailpf8Gkb1OuA6VnqlgT/kz9LgphxmB7r/j6p/GrzDJny54Ik/ls6Pa VLH5K4iHYRL7A4TqKZFb1P12xjPynd5MGNfdFmmIPpVnx2RBJ+vVIQwcwt6ul1GKWVPfb5 aSUrhC7XM5kXZQ7wnRH1SZwgleXUz3BAqF6S0gqdpUCi1afBwtEDtkgslW2YUQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=1a305490732cdd30d19627b49847ebe09009a8f7 commit 1a305490732cdd30d19627b49847ebe09009a8f7 Author: Bjoern A. Zeeb AuthorDate: 2021-12-13 22:10:25 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-12-29 16:01:46 +0000 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. (cherry picked from commit e448ff6f0e8035c3dd5b7bd0872f3f0d91c4e0d0) --- libexec/rc/network.subr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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}