3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-12-25 08:02:38 +01:00

monitor: Fix the OUI check for P2P action frames

wsc_wfa_oui is different from wifi_alliance_oui.  Also use wsc_wfa_oui
instead of a local copy in print_wsc_vendor_extension.
This commit is contained in:
Andrew Zaborowski 2019-10-24 06:29:58 +02:00 committed by Denis Kenzior
parent 75b7d18e0c
commit 580fd757c7

View File

@ -2633,7 +2633,6 @@ static void print_wsc_wfa_ext_attributes(unsigned int level, const char *label,
static void print_wsc_vendor_extension(unsigned int level, const char *label, static void print_wsc_vendor_extension(unsigned int level, const char *label,
const void *data, uint16_t size){ const void *data, uint16_t size){
static const unsigned char wfa_ext[3] = { 0x00, 0x37, 0x2a };
const uint8_t *bytes = data; const uint8_t *bytes = data;
if (size < 3) { if (size < 3) {
@ -2641,7 +2640,7 @@ static void print_wsc_vendor_extension(unsigned int level, const char *label,
return; return;
} }
if (memcmp(data, wfa_ext, sizeof(wfa_ext))) { if (memcmp(data, wsc_wfa_oui, sizeof(wsc_wfa_oui))) {
print_attr(level, "%s: OUI: 0x%02x 0x%02x 0x%02x: len %u", print_attr(level, "%s: OUI: 0x%02x 0x%02x 0x%02x: len %u",
label, bytes[0], bytes[1], bytes[2], size); label, bytes[0], bytes[1], bytes[2], size);
print_hexdump(level + 1, data + 3, size - 3); print_hexdump(level + 1, data + 3, size - 3);
@ -3930,7 +3929,7 @@ static void print_public_action_frame(unsigned int level, const uint8_t *body,
if (body_len < 5) if (body_len < 5)
return; return;
if (!memcmp(oui, wsc_wfa_oui, 3) && oui[3] == 0x09) { if (!memcmp(oui, wifi_alliance_oui, 3) && oui[3] == 0x09) {
if (body[0] != 9) if (body[0] != 9)
return; return;
@ -4060,7 +4059,7 @@ static void print_action_mgmt_frame(unsigned int level,
if (!print_oui(level, oui)) if (!print_oui(level, oui))
return; return;
if (!memcmp(oui, wsc_wfa_oui, 3) && oui[3] == 0x09) if (!memcmp(oui, wifi_alliance_oui, 3) && oui[3] == 0x09)
print_p2p_action_frame(level + 1, body + 5, print_p2p_action_frame(level + 1, body + 5,
body_len - 5); body_len - 5);
} }