mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-11-14 16:09:24 +01:00
mpdu: Validate ATIM mpdu subtype
ATIM management frames have an empty body.
This commit is contained in:
parent
c3aef948db
commit
e106033fce
@ -48,6 +48,12 @@ static bool validate_mgmt_header(const struct mpdu *mpdu, int len, int *offset)
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool validate_atim_mgmt_mpdu(const struct mpdu *mpdu,
|
||||
int len, int *offset)
|
||||
{
|
||||
return *offset == len;
|
||||
}
|
||||
|
||||
static bool validate_authentication_mgmt_mpdu(const struct mpdu *mpdu,
|
||||
int len, int *offset)
|
||||
{
|
||||
@ -95,6 +101,8 @@ static bool validate_mgmt_mpdu(const struct mpdu *mpdu, int len, int *offset)
|
||||
return false;
|
||||
|
||||
switch (mpdu->fc.subtype) {
|
||||
case MPDU_MANAGEMENT_SUBTYPE_ATIM:
|
||||
return validate_atim_mgmt_mpdu(mpdu, len, offset);
|
||||
case MPDU_MANAGEMENT_SUBTYPE_AUTHENTICATION:
|
||||
return validate_authentication_mgmt_mpdu(mpdu, len, offset);
|
||||
case MPDU_MANAGEMENT_SUBTYPE_DEAUTHENTICATION:
|
||||
|
@ -32,6 +32,7 @@ enum mpdu_type {
|
||||
|
||||
/* 802.11, Table 8-1 "Valid type and subtype combinations" */
|
||||
enum mpdu_management_subtype {
|
||||
MPDU_MANAGEMENT_SUBTYPE_ATIM = 0x9,
|
||||
MPDU_MANAGEMENT_SUBTYPE_AUTHENTICATION = 0xB,
|
||||
MPDU_MANAGEMENT_SUBTYPE_DEAUTHENTICATION = 0xC,
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user