eiwd

no dbus iwd with iwctl functionality
git clone https://git.daat.foo/repos/eiwd.git
Log | Files | Refs | Submodules | README | LICENSE

commit 7103bda05868a30cbd79fdc3f75f6e3ee1786283
parent aed383b037ba6fd7c471ea80a300d330cdb96311
Author: James Prestwood <prestwoj@gmail.com>
Date:   Tue, 23 Nov 2021 10:17:31 -0800

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.

Diffstat:
Msrc/netdev.c | 11+++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)

diff --git 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; }