From nobody Thu Jun 4 08:39:16 2026 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 4gWHzt5T7kz6gHpp for ; Thu, 04 Jun 2026 08:39:22 +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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gWHzt2zxSz3tTg for ; Thu, 04 Jun 2026 08:39:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1780562362; 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=yRpQ5c7uPxSq4l0yiy+3qWwvBbJVHwPVsaiY4LpB+HA=; b=MIXKX8PcB8ruRjWYbCz17mCyTKUTd9gSGAO3sfYeR5uveU+FxOAGtGGz5Z/hYM0BqB4rIb j0whdXMnlyfzSWP4ak6Zt4buf4sOnhdLNoKyM4T+Sr++I+9JzwFh59qaVWWzjzDdLuetHb oB3DPcIyXi3OwmKYI1VPSvHbgNzNTPnJq1fa1lFQ20tDHz5fmgp2ecsYH8plKfYEFvS/ZK LVVJWqArDVBCgMHg+vuAd1H6O0jzApYkhIRkEoWDialp5NIVLXNpRCU40crEdynF3MeGxg Jy/Ce6eKp2UGbKdNtktgP0EHLKtQUpLsAQaJpHQ5FWxlNvvyWTv4GeIH8drvwQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1780562362; a=rsa-sha256; cv=none; b=lTj0KOqOiQV6RXZvEiZQcvz+gZDKVuNbjmK/1HkigPt8eTCztIAlkIx5W5AVfTFuc8N7gG 113Zrl2Gt3MwpIbp9CWHStjd99jM2Mt43PFRTvxYEIeF+vhjJiIpWvflRzxk2ofderSA9H nije77ih0fDjgasivlF1aIjJB979QlYtpHNkPhK1UafSCaeYwnmFNJAUUzEr0D0b6mMbKP U44tGsSf+vIs6mrx7j1W785gsN8+t+MZHQXjFpiYGpAnu7DwLmOdyh0JWp2ITNjxjvVsz3 NlDdiFsQBzfcBHml9H2q/4FLNYDEIgKiBI9jxATD8ICXsWtYY6z4YM6xIVv0Gg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1780562362; 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=yRpQ5c7uPxSq4l0yiy+3qWwvBbJVHwPVsaiY4LpB+HA=; b=hmHnfGj+GQ1SlMsOMPvWiBLJYcHWZgyQXuZKa6FXf8VRgnm5nq48vmQoUHmA+iFbORm0Oc fqrsI4cLQv7l++6LcoiM43YA7OpKoIv6E704AXZA/AiPLm1Y2rWMr7QlMMViooyMCprNQG eD/T5TdyJb4gjMY4vmYuK2M7uaoULGP67D3z6zu1NVMCt8yjdFyWf+9/lNEPc/5QmMrtG1 RQJww/bPND+AAP4tYHvVFjg+NvYGsVsQlSEmanZHeyk6DlBFosJ/wN3kqtPBrw6g8RvCpR Ml6Yyp0MYdeYfiVW5nIFcOKWNu3uDoo76LMxLkfxVojUUanJE0fN+qA5W25/nA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gWHzt25czzrWP for ; Thu, 04 Jun 2026 08:39:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3b77a by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 04 Jun 2026 08:39:16 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Pouria Mousavizadeh Tehrani Subject: git: 5b5a836e72ec - main - defaultroute: Fix dual-stack and IPv6-only handling 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pouria X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5b5a836e72ec2614def23409674822c907cf3740 Auto-Submitted: auto-generated Date: Thu, 04 Jun 2026 08:39:16 +0000 Message-Id: <6a2139b4.3b77a.1a6171a9@gitrepo.freebsd.org> The branch main has been updated by pouria: URL: https://cgit.FreeBSD.org/src/commit/?id=5b5a836e72ec2614def23409674822c907cf3740 commit 5b5a836e72ec2614def23409674822c907cf3740 Author: Pouria Mousavizadeh Tehrani AuthorDate: 2026-06-04 07:58:07 +0000 Commit: Pouria Mousavizadeh Tehrani CommitDate: 2026-06-04 08:37:21 +0000 defaultroute: Fix dual-stack and IPv6-only handling Since IPv6-only setups are becoming more common, and IPv6 connectivity is often sufficient for tasks such as DNS resolution and NTP time synchronization, update defaultroute rc.d script to support IPv6-only environments. Reviewed by: pouria, ae Differential Revision: https://reviews.freebsd.org/D56797 --- libexec/rc/rc.d/defaultroute | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/libexec/rc/rc.d/defaultroute b/libexec/rc/rc.d/defaultroute index b96f91d36118..5368dca4cf62 100755 --- a/libexec/rc/rc.d/defaultroute +++ b/libexec/rc/rc.d/defaultroute @@ -1,6 +1,6 @@ #!/bin/sh # -# Wait for the default route to be up if DHCP is in use +# Wait for the default route to be up if DHCPv4 or IPv6 SLAAC is in use # # @@ -22,7 +22,7 @@ defaultroute_carrier() local carrier nocarrier carrier=1 - for _if in ${dhcp_interfaces}; do + for _if in ${dhcp_interfaces} ${autoconf_interfaces}; do output=`/sbin/ifconfig ${_if}` nocarrier=`expr "${output}" : '.*[[:blank:]]status: \(no carrier\)'` [ -z "${nocarrier}" ] && carrier=0 @@ -32,22 +32,30 @@ defaultroute_carrier() defaultroute_start() { - local nl waited + local have_inet have_inet6 nl waited - afexists inet || return 0 + # Check for IPv4/IPv6 support + have_inet=0 + afexists inet && have_inet=1 + have_inet6=0 + afexists inet6 && have_inet6=1 + [ ${have_inet} -eq 0 ] && [ ${have_inet6} -eq 0 ] && return - # Return without waiting if we don't have dhcp interfaces or - # if none of the dhcp interfaces is plugged in. - dhcp_interfaces=`list_net_interfaces dhcp` - [ -z "${dhcp_interfaces}" ] && return + # Return without waiting if we don't have dhcp or autoconf interfaces, + # or if none of them is plugged in. + [ ${have_inet} -ne 0 ] && dhcp_interfaces=`list_net_interfaces dhcp` + [ ${have_inet6} -ne 0 ] && autoconf_interfaces=`list_net_interfaces autoconf` + [ -z "${dhcp_interfaces}" -a -z "${autoconf_interfaces}" ] && return # Wait for a default route waited=0 while [ ${waited} -lt ${defaultroute_delay} ]; do - defif=`get_default_if -inet` - if [ -n "${defif}" ]; then + [ ${have_inet} -ne 0 ] && defif=`get_default_if -inet` + [ ${have_inet6} -ne 0 ] && defif6=`get_default_if -inet6` + if [ -n "${defif}" ] || [ -n "${defif6}" ]; then if [ ${waited} -ne 0 ]; then - echo -n "($defif)" + [ -n "${defif}" ] && echo -n "($defif)=>inet " + [ -n "${defif6}" ] && echo -n "($defif6)=>inet6" nl=1 fi break