From 58a7032ed9326282aabe191014515824fef63ef4 Mon Sep 17 00:00:00 2001 From: Andrew Zaborowski Date: Fri, 22 Sep 2017 05:06:28 +0200 Subject: [PATCH] mpdu: Don't report Action frames as invalid Declare the two missing frame subtype enum values for Action frames, assume Action frames are valid. Once we have specific validation code for any Action frames elsewhere, we can move it to mpdu_validate, but right don't try to validate the frame body as there are many subtypes and we don't use any of them except Neighbor Reports which are actually really simple. --- src/mpdu.c | 3 +++ src/mpdu.h | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/mpdu.c b/src/mpdu.c index 6abf2ac9..3fcb2ac1 100644 --- a/src/mpdu.c +++ b/src/mpdu.c @@ -153,6 +153,9 @@ static bool validate_mgmt_mpdu(const struct mmpdu_header *mpdu, int len, return validate_authentication_mmpdu(mpdu, len, offset); case MPDU_MANAGEMENT_SUBTYPE_DEAUTHENTICATION: return validate_deauthentication_mmpdu(mpdu, len, offset); + case MPDU_MANAGEMENT_SUBTYPE_ACTION: + case MPDU_MANAGEMENT_SUBTYPE_ACTION_NO_ACK: + return true; default: return false; } diff --git a/src/mpdu.h b/src/mpdu.h index 389b9b74..0c1b3c30 100644 --- a/src/mpdu.h +++ b/src/mpdu.h @@ -33,7 +33,7 @@ enum mpdu_type { MPDU_TYPE_MANAGEMENT = 0, }; -/* 802.11, Table 8-1 "Valid type and subtype combinations" */ +/* 802.11-2016, Table 9-1 "Valid type and subtype combinations" */ enum mpdu_management_subtype { MPDU_MANAGEMENT_SUBTYPE_ASSOCIATION_REQUEST = 0x0, MPDU_MANAGEMENT_SUBTYPE_ASSOCIATION_RESPONSE = 0x1, @@ -47,6 +47,8 @@ enum mpdu_management_subtype { MPDU_MANAGEMENT_SUBTYPE_DISASSOCIATION = 0xA, MPDU_MANAGEMENT_SUBTYPE_AUTHENTICATION = 0xB, MPDU_MANAGEMENT_SUBTYPE_DEAUTHENTICATION = 0xC, + MPDU_MANAGEMENT_SUBTYPE_ACTION = 0xD, + MPDU_MANAGEMENT_SUBTYPE_ACTION_NO_ACK = 0xE, }; /* 802.11, Section 8.4.1.1 Authentication Algorithm Number field */