diff mbox series

[02/11] netdev: sa_query: Fix reason code handling

Message ID 20231114171455.1108856-2-denkenz@gmail.com (mailing list archive)
State New
Headers show
Series [01/11] netdev: Fix obtaining reason code from deauth frames | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
prestwoj/iwd-ci-gitlint success GitLint

Commit Message

Denis Kenzior Nov. 14, 2023, 5:14 p.m. UTC
The reason code field was being obtained as a uint8_t value, while it is
actually a uint16_t in little-endian byte order.

Fixes: f3cc96499c44 ("netdev: added support for SA Query")
---
 src/netdev.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/src/netdev.c b/src/netdev.c
index 49854b16d846..72876f3a39a1 100644
--- a/src/netdev.c
+++ b/src/netdev.c
@@ -4956,8 +4956,7 @@  static void netdev_unprot_disconnect_event(struct l_genl_msg *msg,
 	if (!hdr)
 		return;
 
-	/* get reason code, first byte of frame */
-	reason_code = l_get_u8(mmpdu_body(hdr));
+	reason_code = l_get_le16(mmpdu_body(hdr));
 
 	l_info("disconnect event, src="MAC" dest="MAC" bssid="MAC" reason=%u",
 			MAC_STR(hdr->address_2), MAC_STR(hdr->address_1),