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(-)
diff --git a/src/netdev.c b/src/netdev.c
index 96e473a9..34ace286 100644
--- a/src/netdev.c
+++ b/src/netdev.c
@@ -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);
--
2.31.1
Show replies by date
After roaming deauth IWD and check the connection state.
---
autotests/testPSK-roam/connection_test.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/autotests/testPSK-roam/connection_test.py
b/autotests/testPSK-roam/connection_test.py
index 437e52fc..8d9b22ad 100644
--- a/autotests/testPSK-roam/connection_test.py
+++ b/autotests/testPSK-roam/connection_test.py
@@ -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)
--
2.31.1