From: James Prestwood <prestwoj@gmail.com>
To: iwd@lists.linux.dev
Cc: James Prestwood <prestwoj@gmail.com>
Subject: [PATCH] sae: check return on sae_send_commit()
Date: Wed, 28 May 2025 11:14:05 -0700 [thread overview]
Message-ID: <20250528181405.521001-1-prestwoj@gmail.com> (raw)
If this fails, in some cases, -EAGAIN would be returned up to netdev
which would then assume a retry would be done automatically. This
would not in fact happen since it was an internal SAE failure which
would result in the connect method return to never get sent.
Now if sae_send_commit() fails, return -EPROTO which will cause
netdev to fail the connection.
---
src/sae.c | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/src/sae.c b/src/sae.c
index 3305dfdc..4ca9fa61 100644
--- a/src/sae.c
+++ b/src/sae.c
@@ -994,7 +994,8 @@ static int sae_process_anti_clogging(struct sae_sm *sm, const uint8_t *ptr,
sm->token_len = len;
sm->sync = 0;
- sae_send_commit(sm, true);
+ if (!sae_send_commit(sm, true))
+ return -EPROTO;
return -EAGAIN;
}
@@ -1074,7 +1075,9 @@ static int sae_verify_committed(struct sae_sm *sm, uint16_t transaction,
return -ETIMEDOUT;
sm->sync++;
- sae_send_commit(sm, true);
+
+ if (!sae_send_commit(sm, true))
+ return -EPROTO;
return -EAGAIN;
}
@@ -1129,7 +1132,9 @@ static int sae_verify_committed(struct sae_sm *sm, uint16_t transaction,
sm->group);
sm->sync = 0;
- sae_send_commit(sm, false);
+
+ if (!sae_send_commit(sm, false))
+ return -EPROTO;
return -EAGAIN;
}
@@ -1294,7 +1299,8 @@ static int sae_verify_confirmed(struct sae_sm *sm, uint16_t trans,
sm->sync++;
sm->sc++;
- sae_send_commit(sm, true);
+ if (!sae_send_commit(sm, true))
+ return -EPROTO;
if (!sae_send_confirm(sm))
return -EPROTO;
--
2.34.1
reply other threads:[~2025-05-28 18:14 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20250528181405.521001-1-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