Wireless Daemon for Linux
 help / color / mirror / Atom feed
From: James Prestwood <prestwoj@gmail.com>
To: iwd@lists.linux.dev
Cc: James Prestwood <prestwoj@gmail.com>
Subject: [PATCH 2/3] ft: clear ft_info inside offchannel destroy
Date: Tue, 27 Sep 2022 16:15:48 -0700	[thread overview]
Message-ID: <20220927231549.310800-2-prestwoj@gmail.com> (raw)
In-Reply-To: <20220927231549.310800-1-prestwoj@gmail.com>

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);
+	}
 }
 
 /*
-- 
2.34.3


  reply	other threads:[~2022-09-27 23:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-27 23:15 [PATCH 1/3] station: handle ROAMING state in disconnect event James Prestwood
2022-09-27 23:15 ` James Prestwood [this message]
2022-09-27 23:15 ` [PATCH 3/3] ft: fix ft_associate to verify if authentication succeeded James Prestwood
2022-09-28 17:34 ` [PATCH 1/3] station: handle ROAMING state in disconnect event Denis Kenzior

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220927231549.310800-2-prestwoj@gmail.com \
    --to=prestwoj@gmail.com \
    --cc=iwd@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox