File tree Expand file tree Collapse file tree 2 files changed +18
-4
lines changed Expand file tree Collapse file tree 2 files changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -209,14 +209,23 @@ static int validate_beacon_head(const struct nlattr *attr,
209
209
unsigned int len = nla_len (attr );
210
210
const struct element * elem ;
211
211
const struct ieee80211_mgmt * mgmt = (void * )data ;
212
- unsigned int fixedlen = offsetof(struct ieee80211_mgmt ,
213
- u .beacon .variable );
212
+ bool s1g_bcn = ieee80211_is_s1g_beacon (mgmt -> frame_control );
213
+ unsigned int fixedlen , hdrlen ;
214
+
215
+ if (s1g_bcn ) {
216
+ fixedlen = offsetof(struct ieee80211_ext ,
217
+ u .s1g_beacon .variable );
218
+ hdrlen = offsetof(struct ieee80211_ext , u .s1g_beacon );
219
+ } else {
220
+ fixedlen = offsetof(struct ieee80211_mgmt ,
221
+ u .beacon .variable );
222
+ hdrlen = offsetof(struct ieee80211_mgmt , u .beacon );
223
+ }
214
224
215
225
if (len < fixedlen )
216
226
goto err ;
217
227
218
- if (ieee80211_hdrlen (mgmt -> frame_control ) !=
219
- offsetof(struct ieee80211_mgmt , u .beacon ))
228
+ if (ieee80211_hdrlen (mgmt -> frame_control ) != hdrlen )
220
229
goto err ;
221
230
222
231
data += fixedlen ;
Original file line number Diff line number Diff line change @@ -399,6 +399,11 @@ unsigned int __attribute_const__ ieee80211_hdrlen(__le16 fc)
399
399
{
400
400
unsigned int hdrlen = 24 ;
401
401
402
+ if (ieee80211_is_ext (fc )) {
403
+ hdrlen = 4 ;
404
+ goto out ;
405
+ }
406
+
402
407
if (ieee80211_is_data (fc )) {
403
408
if (ieee80211_has_a4 (fc ))
404
409
hdrlen = 30 ;
You can’t perform that action at this time.
0 commit comments