The branch main has been updated by pouria: URL: https://cgit.FreeBSD.org/src/commit/?id=4258829c8f588e502d90fe19a0c18ba81a3761d9
commit 4258829c8f588e502d90fe19a0c18ba81a3761d9 Author: Pouria Mousavizadeh Tehrani <[email protected]> AuthorDate: 2026-06-04 08:46:02 +0000 Commit: Pouria Mousavizadeh Tehrani <[email protected]> CommitDate: 2026-06-04 08:47:41 +0000 Revert "defaultroute: Fix dual-stack and IPv6-only handling" This reverts commit 5b5a836e72ec2614def23409674822c907cf3740. Despite using arcpatch for this commit, I attributed the wrong author of the patch. --- libexec/rc/rc.d/defaultroute | 30 +++++++++++------------------- 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/libexec/rc/rc.d/defaultroute b/libexec/rc/rc.d/defaultroute index 5368dca4cf62..b96f91d36118 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 DHCPv4 or IPv6 SLAAC is in use +# Wait for the default route to be up if DHCP is in use # # @@ -22,7 +22,7 @@ defaultroute_carrier() local carrier nocarrier carrier=1 - for _if in ${dhcp_interfaces} ${autoconf_interfaces}; do + for _if in ${dhcp_interfaces}; do output=`/sbin/ifconfig ${_if}` nocarrier=`expr "${output}" : '.*[[:blank:]]status: \(no carrier\)'` [ -z "${nocarrier}" ] && carrier=0 @@ -32,30 +32,22 @@ defaultroute_carrier() defaultroute_start() { - local have_inet have_inet6 nl waited + local nl waited - # 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 + afexists inet || return 0 - # 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 + # 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 # Wait for a default route waited=0 while [ ${waited} -lt ${defaultroute_delay} ]; do - [ ${have_inet} -ne 0 ] && defif=`get_default_if -inet` - [ ${have_inet6} -ne 0 ] && defif6=`get_default_if -inet6` - if [ -n "${defif}" ] || [ -n "${defif6}" ]; then + defif=`get_default_if -inet` + if [ -n "${defif}" ]; then if [ ${waited} -ne 0 ]; then - [ -n "${defif}" ] && echo -n "($defif)=>inet " - [ -n "${defif6}" ] && echo -n "($defif6)=>inet6" + echo -n "($defif)" nl=1 fi break
