diff --git a/config/usr/bin/fetch-fw b/config/usr/bin/fetch-fw index cff4d04..2fabff0 100755 --- a/config/usr/bin/fetch-fw +++ b/config/usr/bin/fetch-fw @@ -8,6 +8,14 @@ sleep_secs=3 host_name="google.com" log_file="/var/log/fetch-fw.log" +# Re-solicit an IPv6 Router Advertisement now that IPv4 is confirmed +# working (ADDR_ADD means dhclient succeeded, so the link is stable). +# rtsol sends a single Router Solicitation which prompts the router to +# respond with an RA immediately, rather than waiting for its next +# periodic unsolicited RA (which can be several minutes away). Run it +# in the background so it does not delay the firmware fetch. +[ -n "$1" ] && rtsol "$1" 2>/dev/null & + host -R ${max_tries} -W ${sleep_secs} ${host_name} >/dev/null 2>&1 [ $? -ne 0 ] && exit 1 for i in 1 2 3; do @@ -15,4 +23,3 @@ for i in 1 2 3; do (/usr/sbin/fwget >> ${log_file} 2>&1) && exit 0 sleep 3 done - diff --git a/config/usr/local/etc/devd/fetch-fw.conf b/config/usr/local/etc/devd/fetch-fw.conf index 3ee4baf..3f71d37 100644 --- a/config/usr/local/etc/devd/fetch-fw.conf +++ b/config/usr/local/etc/devd/fetch-fw.conf @@ -1,12 +1,13 @@ - # Fetch firmware once an address has been assigned (ADDR_ADD fires # after dhclient or static configuration). Matching LINK_UP here as # well used to tie with the dhclient rules at the same priority and # could win the tie, blocking DHCP entirely - see # /etc/devd/nomadbsd-dhclient.conf. +# +# $subsystem (the interface name) is passed to fetch-fw so it can +# send a Router Solicitation for IPv6 before waiting for DNS. notify 100 { match "system" "IFNET"; match "type" "ADDR_ADD"; - action "daemon /usr/bin/fetch-fw"; + action "daemon /usr/bin/fetch-fw $subsystem"; }; -