diff options
Diffstat (limited to 'net/wireless/scan.c')
-rw-r--r-- | net/wireless/scan.c | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/net/wireless/scan.c b/net/wireless/scan.c index 5af431f2f90a..92339105aa3b 100644 --- a/net/wireless/scan.c +++ b/net/wireless/scan.c | |||
@@ -238,9 +238,8 @@ void cfg80211_bss_age(struct cfg80211_registered_device *dev, | |||
238 | struct cfg80211_internal_bss *bss; | 238 | struct cfg80211_internal_bss *bss; |
239 | unsigned long age_jiffies = msecs_to_jiffies(age_secs * MSEC_PER_SEC); | 239 | unsigned long age_jiffies = msecs_to_jiffies(age_secs * MSEC_PER_SEC); |
240 | 240 | ||
241 | list_for_each_entry(bss, &dev->bss_list, list) { | 241 | list_for_each_entry(bss, &dev->bss_list, list) |
242 | bss->ts -= age_jiffies; | 242 | bss->ts -= age_jiffies; |
243 | } | ||
244 | } | 243 | } |
245 | 244 | ||
246 | void cfg80211_bss_expire(struct cfg80211_registered_device *dev) | 245 | void cfg80211_bss_expire(struct cfg80211_registered_device *dev) |
@@ -309,8 +308,7 @@ static int cmp_ies(u8 num, u8 *ies1, size_t len1, u8 *ies2, size_t len2) | |||
309 | return memcmp(ie1 + 2, ie2 + 2, ie1[1]); | 308 | return memcmp(ie1 + 2, ie2 + 2, ie1[1]); |
310 | } | 309 | } |
311 | 310 | ||
312 | static bool is_bss(struct cfg80211_bss *a, | 311 | static bool is_bss(struct cfg80211_bss *a, const u8 *bssid, |
313 | const u8 *bssid, | ||
314 | const u8 *ssid, size_t ssid_len) | 312 | const u8 *ssid, size_t ssid_len) |
315 | { | 313 | { |
316 | const u8 *ssidie; | 314 | const u8 *ssidie; |
@@ -386,11 +384,10 @@ static bool is_mesh(struct cfg80211_bss *a, | |||
386 | * part in the same mesh. | 384 | * part in the same mesh. |
387 | */ | 385 | */ |
388 | return memcmp(ie + 2, meshcfg, | 386 | return memcmp(ie + 2, meshcfg, |
389 | sizeof(struct ieee80211_meshconf_ie) - 2) == 0; | 387 | sizeof(struct ieee80211_meshconf_ie) - 2) == 0; |
390 | } | 388 | } |
391 | 389 | ||
392 | static int cmp_bss_core(struct cfg80211_bss *a, | 390 | static int cmp_bss_core(struct cfg80211_bss *a, struct cfg80211_bss *b) |
393 | struct cfg80211_bss *b) | ||
394 | { | 391 | { |
395 | int r; | 392 | int r; |
396 | 393 | ||
@@ -435,8 +432,7 @@ static int cmp_bss(struct cfg80211_bss *a, | |||
435 | b->len_information_elements); | 432 | b->len_information_elements); |
436 | } | 433 | } |
437 | 434 | ||
438 | static int cmp_hidden_bss(struct cfg80211_bss *a, | 435 | static int cmp_hidden_bss(struct cfg80211_bss *a, struct cfg80211_bss *b) |
439 | struct cfg80211_bss *b) | ||
440 | { | 436 | { |
441 | const u8 *ie1; | 437 | const u8 *ie1; |
442 | const u8 *ie2; | 438 | const u8 *ie2; |
@@ -448,11 +444,11 @@ static int cmp_hidden_bss(struct cfg80211_bss *a, | |||
448 | return r; | 444 | return r; |
449 | 445 | ||
450 | ie1 = cfg80211_find_ie(WLAN_EID_SSID, | 446 | ie1 = cfg80211_find_ie(WLAN_EID_SSID, |
451 | a->information_elements, | 447 | a->information_elements, |
452 | a->len_information_elements); | 448 | a->len_information_elements); |
453 | ie2 = cfg80211_find_ie(WLAN_EID_SSID, | 449 | ie2 = cfg80211_find_ie(WLAN_EID_SSID, |
454 | b->information_elements, | 450 | b->information_elements, |
455 | b->len_information_elements); | 451 | b->len_information_elements); |
456 | 452 | ||
457 | /* Key comparator must use same algorithm in any rb-tree | 453 | /* Key comparator must use same algorithm in any rb-tree |
458 | * search function (order is important), otherwise ordering | 454 | * search function (order is important), otherwise ordering |
@@ -602,7 +598,7 @@ rb_find_bss(struct cfg80211_registered_device *dev, | |||
602 | 598 | ||
603 | static struct cfg80211_internal_bss * | 599 | static struct cfg80211_internal_bss * |
604 | rb_find_hidden_bss(struct cfg80211_registered_device *dev, | 600 | rb_find_hidden_bss(struct cfg80211_registered_device *dev, |
605 | struct cfg80211_internal_bss *res) | 601 | struct cfg80211_internal_bss *res) |
606 | { | 602 | { |
607 | struct rb_node *n = dev->bss_tree.rb_node; | 603 | struct rb_node *n = dev->bss_tree.rb_node; |
608 | struct cfg80211_internal_bss *bss; | 604 | struct cfg80211_internal_bss *bss; |
@@ -625,7 +621,7 @@ rb_find_hidden_bss(struct cfg80211_registered_device *dev, | |||
625 | 621 | ||
626 | static void | 622 | static void |
627 | copy_hidden_ies(struct cfg80211_internal_bss *res, | 623 | copy_hidden_ies(struct cfg80211_internal_bss *res, |
628 | struct cfg80211_internal_bss *hidden) | 624 | struct cfg80211_internal_bss *hidden) |
629 | { | 625 | { |
630 | if (unlikely(res->pub.beacon_ies)) | 626 | if (unlikely(res->pub.beacon_ies)) |
631 | return; | 627 | return; |
@@ -639,7 +635,7 @@ copy_hidden_ies(struct cfg80211_internal_bss *res, | |||
639 | res->beacon_ies_allocated = true; | 635 | res->beacon_ies_allocated = true; |
640 | res->pub.len_beacon_ies = hidden->pub.len_beacon_ies; | 636 | res->pub.len_beacon_ies = hidden->pub.len_beacon_ies; |
641 | memcpy(res->pub.beacon_ies, hidden->pub.beacon_ies, | 637 | memcpy(res->pub.beacon_ies, hidden->pub.beacon_ies, |
642 | res->pub.len_beacon_ies); | 638 | res->pub.len_beacon_ies); |
643 | } | 639 | } |
644 | 640 | ||
645 | static struct cfg80211_internal_bss * | 641 | static struct cfg80211_internal_bss * |
@@ -704,6 +700,7 @@ cfg80211_bss_update(struct cfg80211_registered_device *dev, | |||
704 | found->pub.len_information_elements = | 700 | found->pub.len_information_elements = |
705 | found->pub.len_proberesp_ies; | 701 | found->pub.len_proberesp_ies; |
706 | } | 702 | } |
703 | |||
707 | if (res->pub.beacon_ies) { | 704 | if (res->pub.beacon_ies) { |
708 | size_t used = dev->wiphy.bss_priv_size + sizeof(*res); | 705 | size_t used = dev->wiphy.bss_priv_size + sizeof(*res); |
709 | size_t ielen = res->pub.len_beacon_ies; | 706 | size_t ielen = res->pub.len_beacon_ies; |