* [PATCH 1/3] station/wsc: remove beacon loss handling
@ 2020-11-03 20:51 James Prestwood
2020-11-03 20:51 ` [PATCH 2/3] netdev: remove handling of beacon loss event James Prestwood
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: James Prestwood @ 2020-11-03 20:51 UTC (permalink / raw)
To: iwd
[-- Attachment #1: Type: text/plain, Size: 2464 bytes --]
Modern kernels ~5.4+ have changed the way lost beacons are
reported and effectively make the lost beacon event useless
because it is immediately followed by a disconnect event. This
does now allow IWD enough time to do much of anything before
the disconnect comes in and we are forced to fully re-connect
to a different AP.
---
src/station.c | 26 --------------------------
src/wsc.c | 3 ---
2 files changed, 29 deletions(-)
diff --git a/src/station.c b/src/station.c
index eb254bf6..db36b748 100644
--- a/src/station.c
+++ b/src/station.c
@@ -2085,29 +2085,6 @@ static bool station_cannot_roam(struct station *station)
station->state == STATION_STATE_ROAMING;
}
-static void station_lost_beacon(struct station *station)
-{
- l_debug("%u", netdev_get_ifindex(station->netdev));
-
- if (station->state != STATION_STATE_ROAMING &&
- station->state != STATION_STATE_CONNECTED)
- return;
-
- /*
- * Tell the roam mechanism to not bother requesting Neighbor Reports,
- * preauthenticating or performing other over-the-DS type of
- * authentication to target AP, even while station->connected_bss is
- * still non-NULL. The current connection is in a serious condition
- * and we might wasting our time with those mechanisms.
- */
- station->roam_no_orig_ap = true;
-
- if (station_cannot_roam(station))
- return;
-
- station_roam_trigger_cb(NULL, station);
-}
-
#define WNM_REQUEST_MODE_PREFERRED_CANDIDATE_LIST (1 << 0)
#define WNM_REQUEST_MODE_TERMINATION_IMMINENT (1 << 3)
#define WNM_REQUEST_MODE_ESS_DISASSOCIATION_IMMINENT (1 << 4)
@@ -2235,9 +2212,6 @@ static void station_netdev_event(struct netdev *netdev, enum netdev_event event,
case NETDEV_EVENT_ASSOCIATING:
l_debug("Associating");
break;
- case NETDEV_EVENT_LOST_BEACON:
- station_lost_beacon(station);
- break;
case NETDEV_EVENT_DISCONNECT_BY_AP:
case NETDEV_EVENT_DISCONNECT_BY_SME:
station_disconnect_event(station, event_data);
diff --git a/src/wsc.c b/src/wsc.c
index 66ddb8bf..aec9900c 100644
--- a/src/wsc.c
+++ b/src/wsc.c
@@ -247,9 +247,6 @@ static void wsc_enrollee_netdev_event(struct netdev *netdev,
case NETDEV_EVENT_AUTHENTICATING:
case NETDEV_EVENT_ASSOCIATING:
break;
- case NETDEV_EVENT_LOST_BEACON:
- l_debug("Lost beacon");
- break;
case NETDEV_EVENT_DISCONNECT_BY_AP:
l_debug("Disconnect by AP");
wsc_enrollee_connect_cb(wsce->netdev,
--
2.26.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/3] netdev: remove handling of beacon loss event
2020-11-03 20:51 [PATCH 1/3] station/wsc: remove beacon loss handling James Prestwood
@ 2020-11-03 20:51 ` James Prestwood
2020-11-03 20:51 ` [PATCH 3/3] auto-t: remove beacon loss tests James Prestwood
2020-11-04 19:41 ` [PATCH 1/3] station/wsc: remove beacon loss handling Denis Kenzior
2 siblings, 0 replies; 4+ messages in thread
From: James Prestwood @ 2020-11-03 20:51 UTC (permalink / raw)
To: iwd
[-- Attachment #1: Type: text/plain, Size: 1819 bytes --]
---
src/netdev.c | 14 --------------
src/netdev.h | 2 --
2 files changed, 16 deletions(-)
diff --git a/src/netdev.c b/src/netdev.c
index 5d3aa862..3f78afbf 100644
--- a/src/netdev.c
+++ b/src/netdev.c
@@ -671,16 +671,6 @@ struct netdev *netdev_find(int ifindex)
return l_queue_find(netdev_list, netdev_match, L_UINT_TO_PTR(ifindex));
}
-static void netdev_lost_beacon(struct netdev *netdev)
-{
- if (!netdev->connected)
- return;
-
- if (netdev->event_filter)
- netdev->event_filter(netdev, NETDEV_EVENT_LOST_BEACON, NULL,
- netdev->user_data);
-}
-
/* Threshold RSSI for roaming to trigger, configurable in main.conf */
static int LOW_SIGNAL_THRESHOLD;
@@ -771,10 +761,6 @@ static void netdev_cqm_event(struct l_genl_msg *msg, struct netdev *netdev)
while (l_genl_attr_next(&nested, &type, &len, &data)) {
switch (type) {
- case NL80211_ATTR_CQM_BEACON_LOSS_EVENT:
- netdev_lost_beacon(netdev);
- break;
-
case NL80211_ATTR_CQM_RSSI_THRESHOLD_EVENT:
if (len != 4)
continue;
diff --git a/src/netdev.h b/src/netdev.h
index 58b63fbd..65fdbaaf 100644
--- a/src/netdev.h
+++ b/src/netdev.h
@@ -40,7 +40,6 @@ enum netdev_result {
enum netdev_event {
NETDEV_EVENT_AUTHENTICATING,
NETDEV_EVENT_ASSOCIATING,
- NETDEV_EVENT_LOST_BEACON,
NETDEV_EVENT_DISCONNECT_BY_AP,
NETDEV_EVENT_DISCONNECT_BY_SME,
NETDEV_EVENT_RSSI_THRESHOLD_LOW,
@@ -89,7 +88,6 @@ typedef void (*netdev_connect_cb_t)(struct netdev *netdev,
*
* NETDEV_EVENT_AUTHENTICATING - unused
* NETDEV_EVENT_ASSOCIATING - unused
- * NETDEV_EVENT_LOST_BEACON - unused
* NETDEV_EVENT_DISCONNECT_BY_AP - MMPDU_REASON_CODE
* NETDEV_EVENT_DISCONNECT_BY_SME - MMPDU_REASON_CODE
* NETDEV_EVENT_RSSI_THRESHOLD_LOW - unused
--
2.26.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 3/3] auto-t: remove beacon loss tests
2020-11-03 20:51 [PATCH 1/3] station/wsc: remove beacon loss handling James Prestwood
2020-11-03 20:51 ` [PATCH 2/3] netdev: remove handling of beacon loss event James Prestwood
@ 2020-11-03 20:51 ` James Prestwood
2020-11-04 19:41 ` [PATCH 1/3] station/wsc: remove beacon loss handling Denis Kenzior
2 siblings, 0 replies; 4+ messages in thread
From: James Prestwood @ 2020-11-03 20:51 UTC (permalink / raw)
To: iwd
[-- Attachment #1: Type: text/plain, Size: 7457 bytes --]
---
.../testFT-8021x-roam/connection_test.py | 76 -----------------
autotests/testFT-PSK-roam/connection_test.py | 83 -------------------
2 files changed, 159 deletions(-)
diff --git a/autotests/testFT-8021x-roam/connection_test.py b/autotests/testFT-8021x-roam/connection_test.py
index 2dfe9ce5..6e905f0d 100644
--- a/autotests/testFT-8021x-roam/connection_test.py
+++ b/autotests/testFT-8021x-roam/connection_test.py
@@ -92,82 +92,6 @@ class Test(unittest.TestCase):
self.assertRaises(Exception, testutil.test_ifaces_connected,
(self.bss_hostapd[0].ifname, device.name))
- def test_roam_on_beacon_loss(self):
- hwsim = Hwsim()
-
- rule0 = hwsim.rules.create()
- rule0.source = self.bss_radio[0].addresses[0]
- rule0.bidirectional = True
-
- rule1 = hwsim.rules.create()
- rule1.source = self.bss_radio[1].addresses[0]
- rule1.bidirectional = True
-
- wd = IWD()
-
- device = wd.list_devices(1)[0]
-
- # Check that iwd selects BSS 0 first
- rule0.signal = -2000
- rule1.signal = -2500
-
- condition = 'not obj.scanning'
- wd.wait_for_object_condition(device, condition)
-
- device.scan()
-
- condition = 'obj.scanning'
- wd.wait_for_object_condition(device, condition)
-
- condition = 'not obj.scanning'
- wd.wait_for_object_condition(device, condition)
-
- ordered_network = device.get_ordered_network("TestFT")
- self.assertEqual(ordered_network.type, NetworkType.eap)
- self.assertEqual(ordered_network.signal_strength, -2000)
-
- condition = 'not obj.connected'
- wd.wait_for_object_condition(ordered_network.network_object, condition)
-
- self.assertFalse(self.bss_hostapd[0].list_sta())
- self.assertFalse(self.bss_hostapd[1].list_sta())
-
- ordered_network.network_object.connect()
-
- condition = 'obj.state == DeviceState.connected'
- wd.wait_for_object_condition(device, condition)
-
- self.assertTrue(self.bss_hostapd[0].list_sta())
- self.assertFalse(self.bss_hostapd[1].list_sta())
-
- testutil.test_iface_operstate(device.name)
- testutil.test_ifaces_connected(self.bss_hostapd[0].ifname, device.name)
- self.assertRaises(Exception, testutil.test_ifaces_connected,
- (self.bss_hostapd[1].ifname, device.name))
-
- # Check that iwd starts transition to BSS 1 in less than 20 seconds
- # from a beacon loss event
- rule0.drop = True
- rule0.signal = -3000
- wd.wait(2)
- rule0.drop = False
-
- condition = 'obj.state == DeviceState.roaming'
- wd.wait_for_object_condition(device, condition)
-
- # Check that iwd is on BSS 1 once out of roaming state and doesn't
- # go through 'disconnected', 'autoconnect', 'connecting' in between
- condition = 'obj.state != DeviceState.roaming'
- wd.wait_for_object_condition(device, condition)
-
- self.assertEqual(device.state, iwd.DeviceState.connected)
- self.assertTrue(self.bss_hostapd[1].list_sta())
-
- testutil.test_iface_operstate(device.name)
- testutil.test_ifaces_connected(self.bss_hostapd[1].ifname, device.name)
- self.assertRaises(Exception, testutil.test_ifaces_connected,
- (self.bss_hostapd[0].ifname, device.name))
-
def tearDown(self):
os.system('ifconfig "' + self.bss_hostapd[0].ifname + '" down')
os.system('ifconfig "' + self.bss_hostapd[1].ifname + '" down')
diff --git a/autotests/testFT-PSK-roam/connection_test.py b/autotests/testFT-PSK-roam/connection_test.py
index 2d65c925..8e69fcd5 100644
--- a/autotests/testFT-PSK-roam/connection_test.py
+++ b/autotests/testFT-PSK-roam/connection_test.py
@@ -98,89 +98,6 @@ class Test(unittest.TestCase):
self.assertRaises(Exception, testutil.test_ifaces_connected,
(self.bss_hostapd[0].ifname, device.name))
- def test_roam_on_beacon_loss(self):
- hwsim = Hwsim()
-
- rule0 = hwsim.rules.create()
- rule0.source = self.bss_radio[0].addresses[0]
- rule0.bidirectional = True
-
- rule1 = hwsim.rules.create()
- rule1.source = self.bss_radio[1].addresses[0]
- rule1.bidirectional = True
-
- # Check that iwd selects BSS 0 first
- rule0.signal = -2000
- rule1.signal = -2500
-
- wd = IWD(True)
-
- psk_agent = PSKAgent("EasilyGuessedPassword")
- wd.register_psk_agent(psk_agent)
-
- device = wd.list_devices(1)[0]
- # prevent autoconnect
- device.disconnect()
-
- condition = 'not obj.scanning'
- wd.wait_for_object_condition(device, condition)
-
- device.scan()
-
- condition = 'obj.scanning'
- wd.wait_for_object_condition(device, condition)
-
- condition = 'not obj.scanning'
- wd.wait_for_object_condition(device, condition)
-
- ordered_network = device.get_ordered_network("TestFT")
- self.assertEqual(ordered_network.type, NetworkType.psk)
- self.assertEqual(ordered_network.signal_strength, -2000)
-
- condition = 'not obj.connected'
- wd.wait_for_object_condition(ordered_network.network_object, condition)
-
- self.assertFalse(self.bss_hostapd[0].list_sta())
- self.assertFalse(self.bss_hostapd[1].list_sta())
-
- ordered_network.network_object.connect()
-
- condition = 'obj.state == DeviceState.connected'
- wd.wait_for_object_condition(device, condition)
-
- self.assertTrue(self.bss_hostapd[0].list_sta())
- self.assertFalse(self.bss_hostapd[1].list_sta())
-
- wd.unregister_psk_agent(psk_agent)
-
- testutil.test_iface_operstate(device.name)
- testutil.test_ifaces_connected(self.bss_hostapd[0].ifname, device.name)
- self.assertRaises(Exception, testutil.test_ifaces_connected,
- (self.bss_hostapd[1].ifname, device.name))
-
- # Check that iwd starts transition to BSS 1 in less than 20 seconds
- # from a beacon loss event
- rule0.drop = True
- rule0.signal = -3000
- wd.wait(2)
- rule0.drop = False
-
- condition = 'obj.state == DeviceState.roaming'
- wd.wait_for_object_condition(device, condition, 20)
-
- # Check that iwd is on BSS 1 once out of roaming state and doesn't
- # go through 'disconnected', 'autoconnect', 'connecting' in between
- condition = 'obj.state != DeviceState.roaming'
- wd.wait_for_object_condition(device, condition, 5)
-
- self.assertEqual(device.state, iwd.DeviceState.connected)
- self.assertTrue(self.bss_hostapd[1].list_sta())
-
- testutil.test_iface_operstate(device.name)
- testutil.test_ifaces_connected(self.bss_hostapd[1].ifname, device.name)
- self.assertRaises(Exception, testutil.test_ifaces_connected,
- (self.bss_hostapd[0].ifname, device.name))
-
def tearDown(self):
os.system('ifconfig "' + self.bss_hostapd[0].ifname + '" down')
os.system('ifconfig "' + self.bss_hostapd[1].ifname + '" down')
--
2.26.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/3] station/wsc: remove beacon loss handling
2020-11-03 20:51 [PATCH 1/3] station/wsc: remove beacon loss handling James Prestwood
2020-11-03 20:51 ` [PATCH 2/3] netdev: remove handling of beacon loss event James Prestwood
2020-11-03 20:51 ` [PATCH 3/3] auto-t: remove beacon loss tests James Prestwood
@ 2020-11-04 19:41 ` Denis Kenzior
2 siblings, 0 replies; 4+ messages in thread
From: Denis Kenzior @ 2020-11-04 19:41 UTC (permalink / raw)
To: iwd
[-- Attachment #1: Type: text/plain, Size: 571 bytes --]
Hi James,
On 11/3/20 2:51 PM, James Prestwood wrote:
> Modern kernels ~5.4+ have changed the way lost beacons are
> reported and effectively make the lost beacon event useless
> because it is immediately followed by a disconnect event. This
> does now allow IWD enough time to do much of anything before
> the disconnect comes in and we are forced to fully re-connect
> to a different AP.
> ---
> src/station.c | 26 --------------------------
> src/wsc.c | 3 ---
> 2 files changed, 29 deletions(-)
>
All applied, thanks.
Regards,
-Denis
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-11-04 19:41 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-03 20:51 [PATCH 1/3] station/wsc: remove beacon loss handling James Prestwood
2020-11-03 20:51 ` [PATCH 2/3] netdev: remove handling of beacon loss event James Prestwood
2020-11-03 20:51 ` [PATCH 3/3] auto-t: remove beacon loss tests James Prestwood
2020-11-04 19:41 ` [PATCH 1/3] station/wsc: remove beacon loss handling Denis Kenzior
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox