From nobody Sun Oct 05 18:42:35 2025 X-Original-To: dev-commits-src-main@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 4cfrqc4lRhz6B8j3; Sun, 05 Oct 2025 18:42:36 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cfrqc10Fpz3dnW; Sun, 05 Oct 2025 18:42:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759689756; 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=8p1gah86hChfz7JOFJ0tq1vDNJI7ex9lRr8qLWrW8L4=; b=AMDQnHLbLlUI0yTaVpm6axCld0kKjSJ1bE4REE2QDFq5NYJAh/ZuswKmIUsY/dzHwfQ5ek I2HClLJgqdHdjVN+ZlS/on+wGAaKdg3xM/iyJtqi/HhtRLD4ScCh16pHETVl6Zrp77L+j1 vM47MspOUdBrLvb3isSfP+kTMq44pIQByuXKiQdY6lf2vAkirIwWfxbIpnOL+x+L78YZX5 wFmO73nD/yRgoW7a5yq9VODCaiCEvMDwVjD2f21NkVv6Fs1npBwbUZqMQkmwG4tU7wuMZF q+TBP7ua7nDG15WEZldIKDWaXvGIaP5QovRzUJ7QKU/O4ntMala890sK3aCbYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759689756; 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=8p1gah86hChfz7JOFJ0tq1vDNJI7ex9lRr8qLWrW8L4=; b=w3Y8U+inY9tCdrzFl2Ljq8Dvs915P0B19d8HX1IIsQadInRioK6+2j46TTdGLNGuacHZRV E4FVZTbcS4IKbi0NRLpRIGwL+r4U6b8f1yLOc2NNC/u8VvuiL3NTpdHg+3fKJJTbim3KEX 6V0fD/Lbba8BM4WjQgrjdHaMYBZIXNX7Cy2X9h8oKmJ4XQlcwHR63vVaj90e2i3lT+t8uT twGiwI6kxga5hNDkerRbGJjV7DkhgLOYRgYQGKEzJCWBwreiyuYvHQNKgK4yqhdgcJq5Pf SUKkK8EB2VNLWtLW2QXXgdTQa+Qy6C0J1wlGmNQHXpVlNQBvdt6WXNAtiqWhiQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759689756; a=rsa-sha256; cv=none; b=YxxIm7nvEFgqfpIRa9eMQSvxnO9sBj+OkwUZVel/o3pLED2ZSlf007Jb2sQ35e7wk39L33 ZRt3o9ZFfiYSr7Ql1lGsQ/qVC8csQfJUwq23mTTJo8FV9rZEVX3Xjjzh4+NtdIXxO9vstY t5ZXNpzBSKfNBONRoWw4YsMnUkUsJhPz2XCcqwQvsAIu2SlSZTKMn8jHPiPPGluQ2zaBVV vmaiwblTDeyFRP+V7NEsIBzLmge9xrRk5MbRAd7JJuRlSXdb6bgi3G96OWaEqbun6HFzZT e20O4v9bz9seI9Gd30Q2XK5qgzfMlroyDwlKW7rsbbSWDFR1KY20WsLzoV75tQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4cfrqb6tzgz8gJ; Sun, 05 Oct 2025 18:42:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 595IgZWc096592; Sun, 5 Oct 2025 18:42:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 595IgZiu096589; Sun, 5 Oct 2025 18:42:35 GMT (envelope-from git) Date: Sun, 5 Oct 2025 18:42:35 GMT Message-Id: <202510051842.595IgZiu096589@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: ec6ad605ecea - main - rc: Improve netwait DAD logic List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ec6ad605ecea5c4a76d2e744df0265cc3f3a01b9 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=ec6ad605ecea5c4a76d2e744df0265cc3f3a01b9 commit ec6ad605ecea5c4a76d2e744df0265cc3f3a01b9 Author: Dag-Erling Smørgrav AuthorDate: 2025-10-05 18:40:39 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-10-05 18:42:33 +0000 rc: Improve netwait DAD logic Disable if IPv6 is not supported, and instead of 10 seconds, default to one more than the value of net.inet6.ip6.dad_count. Fixes: 5ead817c3b7a ("rc: Teach netwait to wait for DAD") Reviewed by: bz Differential Revision: https://reviews.freebsd.org/D52905 --- libexec/rc/rc.conf | 3 ++- libexec/rc/rc.d/netwait | 10 ++++++---- share/man/man5/rc.conf.5 | 9 ++++++--- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/libexec/rc/rc.conf b/libexec/rc/rc.conf index 2589e2614c35..c776a815003c 100644 --- a/libexec/rc/rc.conf +++ b/libexec/rc/rc.conf @@ -501,7 +501,8 @@ netwait_timeout="60" # Total number of seconds to perform pings. #netwait_if="" # Wait for active link on each intf in this list. netwait_if_timeout="30" # Total number of seconds to monitor link state. netwait_dad="NO" # Wait for DAD to complete -netwait_dad_timeout="10" # Total number of seconds to wait for DAD. +netwait_dad_timeout="" # Total number of seconds to wait for DAD, zero + # or unset to autodetect ### Miscellaneous network options: ### icmp_bmcastecho="NO" # respond to broadcast ping packets diff --git a/libexec/rc/rc.d/netwait b/libexec/rc/rc.d/netwait index b609440a2e4e..05874552cf1c 100755 --- a/libexec/rc/rc.d/netwait +++ b/libexec/rc/rc.d/netwait @@ -36,13 +36,15 @@ netwait_start() err 1 "Nothing to wait for" fi - if ! [ "${netwait_if_timeout}" -ge 1 ]; then + if ! [ "${netwait_if_timeout:=0}" -ge 1 ]; then err 1 "netwait_if_timeout must be >= 1" fi - if ! [ "${netwait_dad_timeout}" -ge 1 ]; then - err 1 "netwait_dad_timeout must be >= 1" + if ! check_kern_features inet6; then + netwait_dad="NO" + elif ! [ "${netwait_dad_timeout:=0}" -ge 1 ]; then + netwait_dad_timeout=$(($(sysctl -n net.inet6.ip6.dad_count)+1)) fi - if ! [ "${netwait_timeout}" -ge 1 ]; then + if ! [ "${netwait_timeout:=0}" -ge 1 ]; then err 1 "netwait_timeout must be >= 1" fi diff --git a/share/man/man5/rc.conf.5 b/share/man/man5/rc.conf.5 index c0048f27c740..edbfa937f8df 100644 --- a/share/man/man5/rc.conf.5 +++ b/share/man/man5/rc.conf.5 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd October 2, 2025 +.Dd October 5, 2025 .Dt RC.CONF 5 .Os .Sh NAME @@ -4618,8 +4618,11 @@ Set to to enable waiting for DAD to complete. .It Va netwait_dad_timeout .Pq Vt int -Indicates the total number of seconds to wait for DAD to complete. -The default is 10. +Unset by default. +Indicates the maximum number of seconds to wait for DAD to complete. +If zero or unset, the timeout will be one more than the value of the +.Va net.inet6.ip6.dad_count +sysctl variable. .It Va rctl_enable .Pq Vt bool If set to