netdev: only set in_reassoc if using an auth-proto
James Prestwood
PATCH 1/2 netdev: only set in_reassoc if using an auth-proto
The kernel strangely sends a disconnect event when using auth/assoc commands, but does not for CMD_CONNECT (only deauth). This wasn't observed and IWD assumed a disconnect event comes unconditionally. Because of this in_reassoc is checked in netdev_disconnect_event and the event is ignored if set.
When CMD_CONNECT is used to reassociate this would cause disconnect events to be ignored when they should not be, preventing IWD from going into a disconnected state post-roam.
Now, in_reassoc is only set if an auth-proto is used.
--- src/netdev.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
src/netdev.c +3 -2
@@ -4144,13 +4144,14 @@ int netdev_reassociate(struct netdev *netdev, struct scan_bss *target_bss, netdev->associated = false; netdev->operational = false; netdev->connected = false; - netdev->in_reassoc = true;netdev_connect_common (netdev, target_bss, orig_bss, hs,NULL ,0 , event_filter, cb, user_data); -if (netdev->ap) +if (netdev->ap) { + netdev->in_reassoc = true;memcpy (netdev->ap->prev_bssid, orig_bss->addr,ETH_ALEN ); + }netdev_rssi_polling_update (netdev);
Signature · 1 line
2.31.1
James Prestwood
PATCH 2/2 auto-t: testPSK-roam deauthenticate IWD after roam
After roaming deauth IWD and check the connection state.
--- autotests/testPSK-roam/connection_test.py | 4 ++++ 1 file changed, 4 insertions(+)
autotests/testPSK-roam/connection_test.py +4 -0
@@ -100,6 +100,10 @@ class Test(unittest.TestCase): self.assertRaises(Exception, testutil.test_ifaces_connected, (self.bss_hostapd[1].ifname, device.name, True, True)) + self.bss_hostapd[0].deauthenticate(device.address) + condition = 'obj.state == DeviceState.disconnected' + wd.wait_for_object_condition(device, condition) + def test_ft_psk(self): wd = IWD(True)
Signature · 1 line
2.31.1