From: Aaron LI Date: Wed, 12 Dec 2018 04:06:17 +0000 (+0800) Subject: network.subr: Workaround race between wpa_supplicant and dhcpcd X-Git-Tag: v5.7.0~683 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/e9136cbfc9bca1a07ab401f4e82a641eed0a004c network.subr: Workaround race between wpa_supplicant and dhcpcd Insert a 1-second delay after starting wpa_supplicant(8) to workaround the race between it and dhcpcd(8), which can modify the interface's state and break wpa_supplicant's ongoing SSID scan. dhclient(8) doesn't have such an issue with wpa_supplicant. Tested-by: me, Daniel Bilik --- diff --git a/etc/network.subr b/etc/network.subr index 0d2727da2a..fe4e566043 100644 --- a/etc/network.subr +++ b/etc/network.subr @@ -52,6 +52,14 @@ ifconfig_up() if wpaif $1; then ifconfig $1 up /etc/rc.d/wpa_supplicant start $1 + # NOTE: wpa_supplicant(8) needs to control the interface's + # state in order to perform the SSID scan. But + # dhcpcd(8), which may be started by the "dhcp_client" + # below, can race against wpa_supplicant(8) and modify + # the interface's state, breaking the SSID scan and + # preventing the SSID association. + # Insert a small delay here to workaround the issue. + sleep 1 _cfg=0 # XXX: not sure this should count fi