aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2023-11-13 16:43:39 -0600
committerDenis Kenzior <denkenz@gmail.com>2023-11-13 16:43:39 -0600
commitbef70275f7ef1fdadc00bbbce1cbf72c2139ea03 (patch)
tree2e1e2114b045a813f2ba683f4e0e6a2163f0a292
parentdbce8f9ff9db8711896e63dd1b2942a613b83f5f (diff)
netdev: Fix obtaining reason code from deauth frames
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")
-rw-r--r--src/netdev.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/netdev.c b/src/netdev.c
index 867126583..49854b16d 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),