3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-26 02:19:26 +01:00

netdev: always honor disconnect events if issued by AP

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.
This commit is contained in:
James Prestwood 2021-11-23 10:17:31 -08:00 committed by Denis Kenzior
parent aed383b037
commit 7103bda058

View File

@ -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;
}