mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-11-22 23:09:34 +01:00
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: 2bebb4bdc7
("netdev: Handle deauth frames prior to association")
This commit is contained in:
parent
dbce8f9ff9
commit
bef70275f7
@ -1264,6 +1264,7 @@ static void netdev_deauthenticate_event(struct l_genl_msg *msg,
|
|||||||
uint16_t type, len;
|
uint16_t type, len;
|
||||||
const void *data;
|
const void *data;
|
||||||
const struct mmpdu_header *hdr = NULL;
|
const struct mmpdu_header *hdr = NULL;
|
||||||
|
const struct mmpdu_deauthentication *deauth;
|
||||||
uint16_t reason_code;
|
uint16_t reason_code;
|
||||||
|
|
||||||
l_debug("");
|
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)))
|
if (!memcmp(hdr->address_2, netdev->addr, sizeof(netdev->addr)))
|
||||||
return;
|
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",
|
l_info("deauth event, src="MAC" dest="MAC" bssid="MAC" reason=%u",
|
||||||
MAC_STR(hdr->address_2), MAC_STR(hdr->address_1),
|
MAC_STR(hdr->address_2), MAC_STR(hdr->address_1),
|
||||||
|
Loading…
Reference in New Issue
Block a user