Ticket #107 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

wpa_supplicant fails to survive connection lost

Reported by: Stefan Hellermann <stefan@the2masters.de> Owned by: roy
Priority: normal Milestone:
Component: init.d scripts Version:
Keywords: Cc:

Description

Hi Roy,

I noticed a misbehavior when loosing a wpa connection. dhcpcd is killed (okay) and then wpa_supplicant is killed, too, by /lib/rc/net/wpa_supplicant.sh.

/etc/wpa_supplicant/wpa_cli.sh is called when loosing the connection, it executes /etc/init.d/net.wlan0 stop with IN_BACKGROUND=true and this should stop dhcpcd, but not wpa_supplicant, I think.

I attached a small patch which works for me. It's obvious not correct, now wpa_supplicant isn't stopped on normal shutdown.
But: If I loose the connection now, dhcpcd is stopped. When the connection arrives again wpa_supplicant is still running and catches it. Then dhcpcd is started again. Wonderful :)

Cheers
Stefan

Attachments

openrc-wpa_supplicant.patch Download (0 bytes) - added by Stefan Hellermann <stefan@the2masters.de> 2 years ago.
wrong patch
openrc-wpa_supplicant-v2.patch Download (0 bytes) - added by Stefan Hellermann <stefan@the2masters.de> 2 years ago.
better patch :-)

Change History

Changed 2 years ago by Stefan Hellermann <stefan@the2masters.de>

wrong patch

comment:483 Changed 2 years ago by Stefan Hellermann <stefan@the2masters.de>

Created an attachment (id=50)
wrong patch

Changed 2 years ago by Stefan Hellermann <stefan@the2masters.de>

better patch :-)

comment:484 Changed 2 years ago by Stefan Hellermann <stefan@the2masters.de>

Created an attachment (id=51)
better patch :-)

After looking at the logic I have corrected the patch

Tests done:

  • stopping net.wlan0 normal: dhcpcd + wpa_supplicant is stopped [OK]
  • stopping net.wlan0 with IN_BACKGROUND=true: only dhcpcd is stopped [OK]
  • after stopping it with IN_BACKGROUND stop it again normal: only wpa_supplicant is stopped, no error [OK]
  • killall wpa_supplicant, then stop net.wlan0: only dhcpcd is stopped [OK]

But this doesn't mean the patch is correct :-)

Cheers
Stefan

comment:488 Changed 2 years ago by roy

I'll have to look at this when I have the time.
The issue is that if wpa_supplicant is used for auth on a wired interface controlled by netplug/ifplugd.

comment:514 Changed 2 years ago by roy

  • Status changed from new to resolved
  • Resolution set to fixed
Note: See TracTickets for help on using tickets.