net80211: improve error handling from ieee80211_parse_beacon()

Following up on fb8c87b4f3, which was
supposed to go into all supported branches, increase ieee80211_scanparams
status field from 8bit to 32bit (enum size) and add a dedicated error
code for Mesh ID.

Sponsored by:	The FreeBSD Foundation
This commit is contained in:
Bjoern A. Zeeb 2022-04-07 20:50:39 +00:00
parent ebb16d5e93
commit 7354782698
2 changed files with 3 additions and 2 deletions

View File

@ -745,7 +745,7 @@ ieee80211_parse_beacon(struct ieee80211_node *ni, struct mbuf *m,
#ifdef IEEE80211_SUPPORT_MESH
if (scan->meshid != NULL) {
IEEE80211_VERIFY_ELEMENT(scan->meshid, IEEE80211_MESHID_LEN,
scan->status |= IEEE80211_BPARSE_RATES_INVALID);
scan->status |= IEEE80211_BPARSE_MESHID_INVALID);
}
#endif
/*

View File

@ -213,6 +213,7 @@ enum {
IEEE80211_BPARSE_OFFCHAN = 0x20, /* DSPARMS chan != curchan */
IEEE80211_BPARSE_BINTVAL_INVALID= 0x40, /* invalid beacon interval */
IEEE80211_BPARSE_CSA_INVALID = 0x80, /* invalid CSA ie */
IEEE80211_BPARSE_MESHID_INVALID = 0x100, /* invalid Mesh ID ie */
};
/*
@ -223,7 +224,7 @@ enum {
* All multi-byte values must be in host byte order.
*/
struct ieee80211_scanparams {
uint8_t status; /* bitmask of IEEE80211_BPARSE_* */
uint32_t status; /* bitmask of IEEE80211_BPARSE_* */
uint8_t chan; /* channel # from FH/DSPARMS */
uint8_t bchan; /* curchan's channel # */
uint8_t fhindex;