]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - net/wireless/scan.c
Merge branch 'master' into tk71
[mv-sheeva.git] / net / wireless / scan.c
index 5ca8c7180141d8dc9bc43d607eb26395cd0268bf..ea427f418f641c28f3b19b62fce74984ae86d8fd 100644 (file)
@@ -464,6 +464,9 @@ cfg80211_bss_update(struct cfg80211_registered_device *dev,
                if (res->pub.beacon_ies) {
                        size_t used = dev->wiphy.bss_priv_size + sizeof(*res);
                        size_t ielen = res->pub.len_beacon_ies;
+                       bool information_elements_is_beacon_ies =
+                               (found->pub.information_elements ==
+                                found->pub.beacon_ies);
 
                        if (found->pub.beacon_ies &&
                            !found->beacon_ies_allocated &&
@@ -487,6 +490,14 @@ cfg80211_bss_update(struct cfg80211_registered_device *dev,
                                        found->pub.len_beacon_ies = ielen;
                                }
                        }
+
+                       /* Override IEs if they were from a beacon before */
+                       if (information_elements_is_beacon_ies) {
+                               found->pub.information_elements =
+                                       found->pub.beacon_ies;
+                               found->pub.len_information_elements =
+                                       found->pub.len_beacon_ies;
+                       }
                }
 
                kref_put(&res->ref, bss_release);
@@ -650,14 +661,14 @@ void cfg80211_unlink_bss(struct wiphy *wiphy, struct cfg80211_bss *pub)
        bss = container_of(pub, struct cfg80211_internal_bss, pub);
 
        spin_lock_bh(&dev->bss_lock);
+       if (!list_empty(&bss->list)) {
+               list_del_init(&bss->list);
+               dev->bss_generation++;
+               rb_erase(&bss->rbn, &dev->bss_tree);
 
-       list_del(&bss->list);
-       dev->bss_generation++;
-       rb_erase(&bss->rbn, &dev->bss_tree);
-
+               kref_put(&bss->ref, bss_release);
+       }
        spin_unlock_bh(&dev->bss_lock);
-
-       kref_put(&bss->ref, bss_release);
 }
 EXPORT_SYMBOL(cfg80211_unlink_bss);