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.
This commit is contained in:
James Prestwood 2021-04-02 15:06:15 -07:00 committed by Denis Kenzior
parent 44625373bc
commit 81e3dc6ae6
1 changed files with 11 additions and 7 deletions

View File

@ -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,18 +4119,24 @@ 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;
}
/*