aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless/scan.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/wireless/scan.c')
-rw-r--r--net/wireless/scan.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/net/wireless/scan.c b/net/wireless/scan.c
index 2ac6787f6a42..674aadca0079 100644
--- a/net/wireless/scan.c
+++ b/net/wireless/scan.c
@@ -365,14 +365,18 @@ const u8 *cfg80211_find_vendor_ie(unsigned int oui, u8 oui_type,
365 if (!pos) 365 if (!pos)
366 return NULL; 366 return NULL;
367 367
368 if (end - pos < sizeof(*ie))
369 return NULL;
370
371 ie = (struct ieee80211_vendor_ie *)pos; 368 ie = (struct ieee80211_vendor_ie *)pos;
369
370 /* make sure we can access ie->len */
371 BUILD_BUG_ON(offsetof(struct ieee80211_vendor_ie, len) != 1);
372
373 if (ie->len < sizeof(*ie))
374 goto cont;
375
372 ie_oui = ie->oui[0] << 16 | ie->oui[1] << 8 | ie->oui[2]; 376 ie_oui = ie->oui[0] << 16 | ie->oui[1] << 8 | ie->oui[2];
373 if (ie_oui == oui && ie->oui_type == oui_type) 377 if (ie_oui == oui && ie->oui_type == oui_type)
374 return pos; 378 return pos;
375 379cont:
376 pos += 2 + ie->len; 380 pos += 2 + ie->len;
377 } 381 }
378 return NULL; 382 return NULL;
@@ -1206,16 +1210,6 @@ static void ieee80211_scan_add_ies(struct iw_request_info *info,
1206 } 1210 }
1207} 1211}
1208 1212
1209static inline unsigned int elapsed_jiffies_msecs(unsigned long start)
1210{
1211 unsigned long end = jiffies;
1212
1213 if (end >= start)
1214 return jiffies_to_msecs(end - start);
1215
1216 return jiffies_to_msecs(end + (MAX_JIFFY_OFFSET - start) + 1);
1217}
1218
1219static char * 1213static char *
1220ieee80211_bss(struct wiphy *wiphy, struct iw_request_info *info, 1214ieee80211_bss(struct wiphy *wiphy, struct iw_request_info *info,
1221 struct cfg80211_internal_bss *bss, char *current_ev, 1215 struct cfg80211_internal_bss *bss, char *current_ev,