#!/bin/sh -
#
-# $OpenBSD: netstart,v 1.217 2022/02/22 06:44:40 dlg Exp $
+# $OpenBSD: netstart,v 1.218 2022/06/26 09:36:13 florian Exp $
# Turn off Strict Bourne shell mode.
set +o sh
unset _cmds
}
+# wait for autoconf interfaces
+wait_autoconf_default() {
+ if ifconfig | grep -q ': flags=.*<.*AUTOCONF.*>'; then
+ count=0
+ while ((count++ < 20)); do
+ route -n show | grep -q ^default && break
+ sleep .5
+ done
+ fi
+}
+
# Make sure the invoking user has the right privileges. Check for presence of
# id(1) to avoid problems with diskless setups.
if [[ -x /usr/bin/id ]] && (($(id -u) != 0)); then
route -qn add -net 127 127.0.0.1 -reject
fi
+# If interface autoconf exists, pause a little for at least one default route
+wait_autoconf_default
+
# Configure interfaces that rely on routing
ifmstart "tun tap gif etherip gre egre nvgre eoip vxlan pflow wg"
-# $OpenBSD: rc,v 1.557 2022/06/26 08:08:23 florian Exp $
+# $OpenBSD: rc,v 1.558 2022/06/26 09:36:13 florian Exp $
# System startup script run by init on autoboot or after single-user.
# Output and error are redirected to console by init, and the console is the
reorder_libs
-# If interface autoconf exists, pause a little for at least one default route
-if ifconfig | grep -q ': flags=.*<.*AUTOCONF.*>'; then
- count=0
- while ((count++ < 20)); do
- route -n show | grep -q ^default && break
- sleep .5
- done
-fi
-
# Load pf rules and bring up pfsync interface.
if [[ $pf != NO ]]; then
if [[ -f /etc/pf.conf ]]; then