3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-29 05:39:24 +01:00

ft: optimize clearing authentications

Clearing all authentications during ft_authenticate was a very large
hammer and may remove cached authentications that could be used if
the current auth attempt fails.

For example the best BSS may have a problem and fail to authenticate
early with FT-over-DS, then fail with FT-over-Air. But another BSS
may have succeeded early with FT-over-DS. If ft_authenticate clears
all ft_infos that successful authentication will be lost.
This commit is contained in:
James Prestwood 2022-09-28 11:33:51 -07:00 committed by Denis Kenzior
parent edf556cc7b
commit 59d36cf24f

View File

@ -1033,7 +1033,6 @@ int ft_authenticate(uint32_t ifindex, const struct scan_bss *target)
target->frequency, target->frequency,
200, ft_send_authenticate, info, 200, ft_send_authenticate, info,
ft_authenticate_destroy); ft_authenticate_destroy);
ft_clear_authentications(ifindex);
l_queue_push_tail(info_list, info); l_queue_push_tail(info_list, info);
@ -1055,9 +1054,20 @@ int ft_associate(uint32_t ifindex, const uint8_t *addr)
* a different BSS. * a different BSS.
*/ */
info = ft_info_find(ifindex, addr); info = ft_info_find(ifindex, addr);
if (!info || !info->parsed) if (!info)
return -ENOENT; return -ENOENT;
/*
* Either failed or no response. This may have been an FT-over-DS
* attempt so clear out the entry so FT-over-Air can try again.
*/
if (!info->parsed) {
l_queue_remove(info_list, info);
ft_info_destroy(info);
return -ENOENT;
}
ft_prepare_handshake(info, hs); ft_prepare_handshake(info, hs);
ret = ft_tx_reassociate(ifindex, info->frequency, info->prev_bssid); ret = ft_tx_reassociate(ifindex, info->frequency, info->prev_bssid);