mac80211: parse Timeout Interval Element using a struct
Instead of open-coding the accesses and length check do the length check in the IE parser and assign a struct pointer for use in the remaining code. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
@@ -874,8 +874,10 @@ u32 ieee802_11_parse_elems_crc(u8 *start, size_t len,
|
||||
elems->pwr_constr_elem = pos;
|
||||
break;
|
||||
case WLAN_EID_TIMEOUT_INTERVAL:
|
||||
elems->timeout_int = pos;
|
||||
elems->timeout_int_len = elen;
|
||||
if (elen >= sizeof(struct ieee80211_timeout_interval_ie))
|
||||
elems->timeout_int = (void *)pos;
|
||||
else
|
||||
elem_parse_failed = true;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
Reference in New Issue
Block a user