mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2025-01-09 16:42:33 +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;
|
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,
|
static bool validate_authentication_mgmt_mpdu(const struct mpdu *mpdu,
|
||||||
int len, int *offset)
|
int len, int *offset)
|
||||||
{
|
{
|
||||||
@ -95,6 +101,8 @@ static bool validate_mgmt_mpdu(const struct mpdu *mpdu, int len, int *offset)
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
switch (mpdu->fc.subtype) {
|
switch (mpdu->fc.subtype) {
|
||||||
|
case MPDU_MANAGEMENT_SUBTYPE_ATIM:
|
||||||
|
return validate_atim_mgmt_mpdu(mpdu, len, offset);
|
||||||
case MPDU_MANAGEMENT_SUBTYPE_AUTHENTICATION:
|
case MPDU_MANAGEMENT_SUBTYPE_AUTHENTICATION:
|
||||||
return validate_authentication_mgmt_mpdu(mpdu, len, offset);
|
return validate_authentication_mgmt_mpdu(mpdu, len, offset);
|
||||||
case MPDU_MANAGEMENT_SUBTYPE_DEAUTHENTICATION:
|
case MPDU_MANAGEMENT_SUBTYPE_DEAUTHENTICATION:
|
||||||
|
@ -32,6 +32,7 @@ enum mpdu_type {
|
|||||||
|
|
||||||
/* 802.11, Table 8-1 "Valid type and subtype combinations" */
|
/* 802.11, Table 8-1 "Valid type and subtype combinations" */
|
||||||
enum mpdu_management_subtype {
|
enum mpdu_management_subtype {
|
||||||
|
MPDU_MANAGEMENT_SUBTYPE_ATIM = 0x9,
|
||||||
MPDU_MANAGEMENT_SUBTYPE_AUTHENTICATION = 0xB,
|
MPDU_MANAGEMENT_SUBTYPE_AUTHENTICATION = 0xB,
|
||||||
MPDU_MANAGEMENT_SUBTYPE_DEAUTHENTICATION = 0xC,
|
MPDU_MANAGEMENT_SUBTYPE_DEAUTHENTICATION = 0xC,
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user