From: Denis Kenzior <denkenz@gmail.com>
To: iwd@lists.linux.dev
Cc: Denis Kenzior <denkenz@gmail.com>
Subject: [PATCH 01/11] netdev: Fix obtaining reason code from deauth frames
Date: Tue, 14 Nov 2023 11:14:24 -0600 [thread overview]
Message-ID: <20231114171455.1108856-1-denkenz@gmail.com> (raw)
The reason code from deauthentication frame was being obtained as a
uint8_t instead of a uint16_t. The value was only ever used in an
informational statement. Since the value was in little endian, only the
first 8 bits of the reason code were obtained. Fix that.
Fixes: 2bebb4bdc7ee ("netdev: Handle deauth frames prior to association")
---
src/netdev.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/netdev.c b/src/netdev.c
index 867126583215..49854b16d846 100644
--- a/src/netdev.c
+++ b/src/netdev.c
@@ -1264,6 +1264,7 @@ static void netdev_deauthenticate_event(struct l_genl_msg *msg,
uint16_t type, len;
const void *data;
const struct mmpdu_header *hdr = NULL;
+ const struct mmpdu_deauthentication *deauth;
uint16_t reason_code;
l_debug("");
@@ -1298,7 +1299,8 @@ static void netdev_deauthenticate_event(struct l_genl_msg *msg,
if (!memcmp(hdr->address_2, netdev->addr, sizeof(netdev->addr)))
return;
- reason_code = l_get_u8(mmpdu_body(hdr));
+ deauth = mmpdu_body(hdr);
+ reason_code = L_LE16_TO_CPU(deauth->reason_code);
l_info("deauth event, src="MAC" dest="MAC" bssid="MAC" reason=%u",
MAC_STR(hdr->address_2), MAC_STR(hdr->address_1),
--
2.42.0
next reply other threads:[~2023-11-14 17:15 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-14 17:14 Denis Kenzior [this message]
2023-11-14 17:14 ` [PATCH 02/11] netdev: sa_query: Fix reason code handling Denis Kenzior
2023-11-14 17:14 ` [PATCH 03/11] netdev: Use CMD_DISCONNECT if OCI fails Denis Kenzior
2023-11-14 17:14 ` [PATCH 04/11] netdev: Don't unnecessarily call netdev_connect_failed Denis Kenzior
2023-11-14 17:14 ` [PATCH 05/11] netdev: Move CMD_DISCONNECT builder to nl80211util Denis Kenzior
2023-11-14 17:14 ` [PATCH 06/11] netdev: Move CMD_DEAUTHENTICATE " Denis Kenzior
2023-11-14 17:14 ` [PATCH 07/11] netdev: Move CMD_DEL_STATION " Denis Kenzior
2023-11-14 17:14 ` [PATCH 08/11] netdev: Move pairwise NEW_KEY " Denis Kenzior
2023-11-14 17:14 ` [PATCH 09/11] netdev: Move CMD_NEW_KEY RX-only " Denis Kenzior
2023-11-14 17:14 ` [PATCH 10/11] netdev: Move CMD_REKEY_OFFLOAD " Denis Kenzior
2023-11-14 17:14 ` [PATCH 11/11] netdev: disambiguate between disconnection types Denis Kenzior
2023-11-14 17:39 ` James Prestwood
2023-11-14 20:09 ` Denis Kenzior
2023-11-14 20:11 ` James Prestwood
2023-11-24 12:20 ` Alvin Šipraga
2023-11-24 16:25 ` Denis Kenzior
2023-11-25 20:57 ` Alvin Šipraga
2023-11-14 20:48 ` [PATCH 01/11] netdev: Fix obtaining reason code from deauth frames 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=20231114171455.1108856-1-denkenz@gmail.com \
--to=denkenz@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