cfg80211: unify IE search
authorVladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Wed, 25 Jul 2012 10:56:53 +0000 (13:56 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 31 Jul 2012 14:11:01 +0000 (16:11 +0200)
Remove ah-hoc IE search code found in the ieee80211_bss_get_ie()
and use cfg80211_find_ie() instead.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/wireless/util.c

index 26f8cd30f712dc190d9e207e4dff989a75106c66..ce393dd8c9283fa4ca37ee2c16105f3ac3a75fcc 100644 (file)
@@ -684,22 +684,10 @@ EXPORT_SYMBOL(cfg80211_classify8021d);
 
 const u8 *ieee80211_bss_get_ie(struct cfg80211_bss *bss, u8 ie)
 {
-       u8 *end, *pos;
-
-       pos = bss->information_elements;
-       if (pos == NULL)
+       if (bss->information_elements == NULL)
                return NULL;
-       end = pos + bss->len_information_elements;
-
-       while (pos + 1 < end) {
-               if (pos + 2 + pos[1] > end)
-                       break;
-               if (pos[0] == ie)
-                       return pos;
-               pos += 2 + pos[1];
-       }
-
-       return NULL;
+       return cfg80211_find_ie(ie, bss->information_elements,
+                                bss->len_information_elements);
 }
 EXPORT_SYMBOL(ieee80211_bss_get_ie);