From ae0fa6207e0d9438bb4a69e82ea8c18f52aa44f8 Mon Sep 17 00:00:00 2001 From: James Prestwood Date: Tue, 27 Sep 2022 16:15:48 -0700 Subject: [PATCH] ft: clear ft_info inside offchannel destroy Once offchannel completes we can check if the info structure was parsed, indicating authentication succeeded. If not there is no reason to keep it around since IWD will either try another BSS or fail. --- src/ft.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/ft.c b/src/ft.c index 72c42309..5b53810a 100644 --- a/src/ft.c +++ b/src/ft.c @@ -960,18 +960,17 @@ void __ft_rx_authenticate(uint32_t ifindex, const uint8_t *frame, &status, &ies, &ies_len)) return; - /* Verified to be expected target, offchannel can be canceled */ - offchannel_cancel(netdev_get_wdev_id(netdev), info->offchannel_id); - if (status != 0) - return; + goto cancel; if (!ft_parse_ies(info, hs, ies, ies_len)) - return; + goto cancel; info->parsed = true; - return; +cancel: + /* Verified to be expected target, offchannel can be canceled */ + offchannel_cancel(netdev_get_wdev_id(netdev), info->offchannel_id); } static void ft_send_authenticate(void *user_data) @@ -1007,6 +1006,11 @@ static void ft_authenticate_destroy(int error, void *user_data) struct ft_info *info = user_data; info->offchannel_id = 0; + + if (!info->parsed) { + l_queue_remove(info_list, info); + ft_info_destroy(info); + } } /*