commit 81e3dc6ae686290c12e384a5826dea6074a639f7
parent 44625373bc81b36e88194ddc41371afd04dd85c0
Author: James Prestwood <prestwoj@gmail.com>
Date: Fri, 2 Apr 2021 15:06:15 -0700
netdev: fix CMD_ROAM for open networks
In the FW scan callback eapol was being stared unconditionally which
isn't correct as roaming on open networks is possible. Instead check
that a SM exists just like is done in netdev_connect_event.
Diffstat:
1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/src/netdev.c b/src/netdev.c
@@ -4107,9 +4107,7 @@ static bool netdev_get_fw_scan_cb(int err, struct l_queue *bss_list,
if (err < 0) {
l_error("Failed to get scan after roam (%d)", err);
- netdev_connect_failed(netdev, NETDEV_RESULT_ABORTED,
- MMPDU_REASON_CODE_UNSPECIFIED);
- return false;
+ goto failed;
}
/*
@@ -4121,17 +4119,23 @@ static bool netdev_get_fw_scan_cb(int err, struct l_queue *bss_list,
if (!bss) {
l_error("Roam target BSS not found in scan results");
- netdev_connect_failed(netdev, NETDEV_RESULT_ABORTED,
- MMPDU_REASON_CODE_UNSPECIFIED);
- return false;
+ goto failed;
}
netdev->fw_roam_bss = bss;
handshake_state_set_authenticator_ie(netdev->handshake, bss->rsne);
- eapol_start(netdev->sm);
+ if (netdev->sm) {
+ if (!eapol_start(netdev->sm))
+ goto failed;
+ }
+
+ return false;
+failed:
+ netdev_connect_failed(netdev, NETDEV_RESULT_ABORTED,
+ MMPDU_REASON_CODE_UNSPECIFIED);
return false;
}