From: James Prestwood <prestwoj@gmail.com>
To: iwd@lists.01.org
Subject: [PATCH 1/3] netdev: better handle associate timeouts with auth_protos
Date: Mon, 29 Mar 2021 13:17:14 -0700 [thread overview]
Message-ID: <20210329201716.716947-1-prestwoj@gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1218 bytes --]
Any auth proto which did not implement the assoc_timeout handler
could end up getting 'stuck' forever if there was an associate
timeout. This is because in the event of an associate timeout IWD
only sets a few flags and relies on the connect event to actually
handle the failure. The problem is a connect event never comes
when using CMD_AUTH/ASSOC directly.
To fix this we can explicitly fail the connection if the auth
proto has not implemented assoc_timeout or if it returns false.
---
src/netdev.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/src/netdev.c b/src/netdev.c
index 8d3f4a08..d5bad57e 100644
--- a/src/netdev.c
+++ b/src/netdev.c
@@ -2339,6 +2339,16 @@ static void netdev_associate_event(struct l_genl_msg *msg,
return;
assoc_failed:
+ /*
+ * There will be no connect event when using Auth/Assoc directly so
+ * the failed connection must be explicitly initiated here.
+ */
+ if (netdev->ap) {
+ netdev_connect_failed(netdev, NETDEV_RESULT_ASSOCIATION_FAILED,
+ status_code);
+ return;
+ }
+
netdev->result = NETDEV_RESULT_ASSOCIATION_FAILED;
netdev->last_code = status_code;
netdev->expect_connect_failure = true;
--
2.26.2
next reply other threads:[~2021-03-29 20:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-29 20:17 James Prestwood [this message]
2021-03-29 20:17 ` [PATCH 2/3] sae: add counter for associate retries James Prestwood
2021-03-29 20:17 ` [PATCH 3/3] netdev: remove unneeded goto/return code James Prestwood
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=20210329201716.716947-1-prestwoj@gmail.com \
--to=prestwoj@gmail.com \
--cc=iwd@lists.01.org \
/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