From nobody Mon Dec 13 22:18:58 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 B5BBD18D1F7D; Mon, 13 Dec 2021 22:18:58 +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 4JCbWk3QFfz3tNq; Mon, 13 Dec 2021 22:18:58 +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 5605C1C8BA; Mon, 13 Dec 2021 22:18:58 +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 1BDMIwTA011686; Mon, 13 Dec 2021 22:18:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BDMIwe3011685; Mon, 13 Dec 2021 22:18:58 GMT (envelope-from git) Date: Mon, 13 Dec 2021 22:18:58 GMT Message-Id: <202112132218.1BDMIwe3011685@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: e448ff6f0e80 - main - 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/main X-Git-Reftype: branch X-Git-Commit: e448ff6f0e8035c3dd5b7bd0872f3f0d91c4e0d0 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1639433938; 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=6OofVKNt03gPiLUPXwR0bD949c/AUqw/czhVQKYCfDw=; b=ju89l9dSApLR+REn0Jc4lApYORyE6G623ESvpFrRsvxhMX48/5gztfunUGTOF4eYr83LFO urzpR+101yB/vAR+fEV/Cd8XwpzwfvfxyCpCwjlTq2qelcdFuQiRnjlFn6W80xxdYdRfz/ 8ekeXO3aGvGbtQE/YYrn2NpAUQ9903hWDQBdNybQdzbLKaLMXhGT6WqSRW2CkVH+Kp7LIn dM9RvJyDLkgEQLtf0lbxC9+xa1d7dRqvQhPHX3Lx0GBzSEeDwEzGcCRcmYehffzmsvHnBJ jR2IkMj0lNV8kHaTMDSOlKDH+Vpd7ImHhE+Hjx2Q3LhMX8J/aqBMfet3emvrYg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1639433938; a=rsa-sha256; cv=none; b=XUbHsJvO20nnW4jk5BeyT0y3FP6wvVb4Rgmj5PO1lkMgEOGLEMnCPcv6qBKPtHidDzpCFl gyCQhv9jNAVn45nlJoq9AYkwJgMa/3BBUoqDZhSjY41mzm1PODC7gPyXG8m38jTABYFqJE aZQj2819o+v/UVopSykZ510qvxv47MSFSlKalF51UCyerTFBhzX1hNr1U51Tu+sDuc5zIx TDBdhPd+FcZDReo/V7bCUdTAa4RBuK2wpUYPcNTmAQJwZShXtuJB2XjqTTgsRSOb0iQ7gE CO0QZMI7U5cPnSq2yhuY6HT8d1zNOxWvKB8ehmp2GirMnWw9+Pn4NBoGBuCleQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=e448ff6f0e8035c3dd5b7bd0872f3f0d91c4e0d0 commit e448ff6f0e8035c3dd5b7bd0872f3f0d91c4e0d0 Author: Bjoern A. Zeeb AuthorDate: 2021-12-13 22:10:25 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-12-13 22:12:44 +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. MFC after: 1 week --- 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}