I have a server that configures a wg(4) interface to include a peer where wgendpoint is specified via a DNS address. This had been working prior to upgrading to 7.0. The below patch gets it working again by starting dhcpleased before calling netstart in rc, and moving the wait for a default route into netstart, before the wg interfaces are started.
Index: netstart =================================================================== RCS file: /cvs/src/etc/netstart,v retrieving revision 1.216 diff -u -r1.216 netstart --- netstart 2 Sep 2021 19:38:20 -0000 1.216 +++ netstart 31 Oct 2021 21:21:05 -0000 @@ -359,6 +359,15 @@ route -qn add -net 127 127.0.0.1 -reject fi +# 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 + # Configure interfaces that rely on routing ifmstart "tun tap gif etherip gre egre pflow wg" Index: rc =================================================================== RCS file: /cvs/src/etc/rc,v retrieving revision 1.554 diff -u -r1.554 rc --- rc 1 Sep 2021 08:15:53 -0000 1.554 +++ rc 31 Oct 2021 21:21:05 -0000 @@ -441,7 +441,7 @@ sysctl_conf -start_daemon slaacd >/dev/null 2>&1 +start_daemon slaacd dhcpleased >/dev/null 2>&1 echo 'starting network' @@ -455,20 +455,11 @@ mount -s /var >/dev/null 2>&1 mount -s /var/log >/dev/null 2>&1 -start_daemon dhcpleased unwind resolvd >/dev/null 2>&1 +start_daemon unwind resolvd >/dev/null 2>&1 random_seed 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