commit 22f238706cbc6fe02287bdf3b726c7f1fe506126
parent 906afefbf32e2cde0e16f222e4a4033c2bb61f03
Author: James Prestwood <prestwoj@gmail.com>
Date: Thu, 18 Jul 2024 04:45:07 -0700
station: update logic for handshake failure
After adding the NETDEV_RESULT_DISCONNECTED enum, handshake failures
initiated by the AP come in via this result so the existing logic
to call network_connect_failed() was broken. We could still get a
handshake failure generated internally, so that has been preserved
(via NETDEV_RESULT_HANDSHAKE_FAILED) but a check for a 4-way
handshake timeout reason code was also added.
Diffstat:
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/station.c b/src/station.c
@@ -3368,7 +3368,13 @@ static void station_connect_cb(struct netdev *netdev, enum netdev_result result,
continue_autoconnect = station->state == STATION_STATE_CONNECTING_AUTO;
if (station->state == STATION_STATE_CONNECTING) {
- bool during_eapol = result == NETDEV_RESULT_HANDSHAKE_FAILED;
+ /*
+ * Either a handshake failure (generated internally) or a 4-way
+ * handshake timeout should trigger the PSK to be asked for
+ * again. Set during_eapol accordingly.
+ */
+ bool during_eapol = result == NETDEV_RESULT_HANDSHAKE_FAILED ||
+ reason == MMPDU_REASON_CODE_4WAY_HANDSHAKE_TIMEOUT;
network_connect_failed(station->connected_network,
during_eapol);
}