Re: wlan0 no longer functional after n249128-a0c64a443e4c -> n249146-cb5c07649aa0

From: Jakob Alvermark <jakob_at_alvermark.net>
Date: Tue, 07 Sep 2021 08:13:23 UTC
On 9/6/21 8:21 PM, Cy Schubert wrote:
> In message <2780735.SSXfckUlLJ@sigill.theweb.org.ua>, "Oleg V. Nauman"
> writes:
>> On 2021 M09 6, Mon 20:31:33 EEST Cy Schubert wrote:
>>> One last favour to ask, can you try this with the wpa_supplicant-devel
>>> port, please? I'm trying to narrow down if this is related to the options
>>> in usr.sbin/wpa/Makefile.inc or an upstream problem. If this behaves the
>>> same using wpa_supplicant-devel, this tells me to look at the code instead
>>> of Makefiles.
>>>
>>> I can reproduce the service netif restart problem using the old
>>> wpa_supplicant 2.9, so at least here there is no change in behaviour.
>>> Though on my sandbox machine the ifconfig dow/up is not required -- though
>>> even the older wpa_supplicant 2.9 behaves the same on my laptop, (no
>>> regression experienced here).
>>>
>>> To help point to either Makefile.inc or contrib/wpa, can you please try the
>>> wpa_supplicant-devel port. This will tell me where to look next.
>>   I can confirm that wpa_supplicant from security/wpa_supplicant-devel port
>> demonstrating the same behavior as wpa_supplicant from base - "ifconfig wlan0
>>   
>> down ; sleep 5 ; ifconfig wlan0 up" mitigate wlan association issue.
> Thank you.
>
> This is an issue that I'll need to chase down with our upstream. In the
> mean time while work on this/bring it to upstream's attention this should
> circumvent the issue:
>
> diff --git a/libexec/rc/rc.d/wpa_supplicant b/libexec/rc/rc.d/wpa_supplicant
> index 8a86fec90e4d..cfe5f1ab27c6 100755
> --- a/libexec/rc/rc.d/wpa_supplicant
> +++ b/libexec/rc/rc.d/wpa_supplicant
> @@ -12,6 +12,7 @@
>   
>   name="wpa_supplicant"
>   desc="WPA/802.11i Supplicant for wireless network devices"
> +start_postcmd="wpa_poststart"
>   rcvar=
>   
>   ifn="$2"
> @@ -27,6 +28,12 @@ is_ndis_interface()
>   	esac
>   }
>   
> +wpa_poststart() {
> +	ifconfig ${ifn} down
> +	sleep 3
> +	ifconfig ${ifn} up
> +}
> +
>   if is_wired_interface ${ifn} ; then
>   	driver="wired"
>   elif is_ndis_interface ${ifn} ; then
>
> I'll have more questions later (need to start working on another job) but
> I'd like to learn more about your configuration to understand why it works
> at boot for myself and phlip@ and not for you and the others here on
> -current who have experienced the same issue. Understanding what triggers
> this will go a long way to resolving it.
>
> (cc'd philip@)
>
> BTW, my laptop is configured so that wlan0 (iwn0) and bge0 are members of
> lagg0. Whereas on my sandbox wlan0 (ath0) is used directly.
>

Hi, I have the same.

wlan0 does not associate after boot. (This is with iwm, AC 9260)

My workaround is simply 'ifconfig wlan0 up'.

After a few seconds wpa_supplicant associates and another few secods 
later I have a DHCP IP address.


Jakob