* [PATCH v2 1/2] netdev: always honor disconnect events if issued by AP
@ 2021-11-23 18:17 James Prestwood
0 siblings, 0 replies; 2+ messages in thread
From: James Prestwood @ 2021-11-23 18:17 UTC (permalink / raw)
To: iwd
[-- Attachment #1: Type: text/plain, Size: 1553 bytes --]
The disconnect event handler was mistakenly bailing out if FT or
reassociation was going on. This was done because a disconnect
event is sent by the kernel when CMD_AUTH/CMD_ASSOC is used.
The problem is an AP could also disconnect IWD which should never
be ignored.
To fix this always parse the disconnect event and, if issued by
the AP, always notify watchers of the disconnect.
---
src/netdev.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/src/netdev.c b/src/netdev.c
index 96e473a9..e35a8b82 100644
--- a/src/netdev.c
+++ b/src/netdev.c
@@ -1165,8 +1165,7 @@ static void netdev_disconnect_event(struct l_genl_msg *msg,
l_debug("");
- if (!netdev->connected || netdev->disconnect_cmd_id > 0 ||
- netdev->in_ft || netdev->in_reassoc)
+ if (!netdev->connected || netdev->disconnect_cmd_id > 0)
return;
if (!l_genl_attr_init(&attr, msg)) {
@@ -1190,6 +1189,13 @@ static void netdev_disconnect_event(struct l_genl_msg *msg,
}
}
+ /*
+ * Only ignore this event if issued by the kernel since this is
+ * normal when using CMD_AUTH/ASSOC.
+ */
+ if (!disconnect_by_ap && (netdev->in_ft || netdev->in_reassoc))
+ return;
+
l_info("Received Deauthentication event, reason: %hu, from_ap: %s",
reason_code, disconnect_by_ap ? "true" : "false");
@@ -3171,6 +3177,7 @@ static void netdev_associate_event(struct l_genl_msg *msg,
if (!netdev->ap) {
netdev->associated = true;
+ netdev->in_reassoc = false;
return;
}
--
2.31.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2 1/2] netdev: always honor disconnect events if issued by AP
@ 2021-11-23 18:19 Denis Kenzior
0 siblings, 0 replies; 2+ messages in thread
From: Denis Kenzior @ 2021-11-23 18:19 UTC (permalink / raw)
To: iwd
[-- Attachment #1: Type: text/plain, Size: 613 bytes --]
Hi James,
On 11/23/21 12:17 PM, James Prestwood wrote:
> The disconnect event handler was mistakenly bailing out if FT or
> reassociation was going on. This was done because a disconnect
> event is sent by the kernel when CMD_AUTH/CMD_ASSOC is used.
>
> The problem is an AP could also disconnect IWD which should never
> be ignored.
>
> To fix this always parse the disconnect event and, if issued by
> the AP, always notify watchers of the disconnect.
> ---
> src/netdev.c | 11 +++++++++--
> 1 file changed, 9 insertions(+), 2 deletions(-)
>
Both applied, thanks.
Regards,
-Denis
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-11-23 18:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-23 18:17 [PATCH v2 1/2] netdev: always honor disconnect events if issued by AP James Prestwood
-- strict thread matches above, loose matches on Subject: below --
2021-11-23 18:19 Denis Kenzior
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox