cfg80211: unify IE search

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Sat Sep 29 10:59:36 EDT 2012


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=e21768928d73df55e648869d3ae159475d1e4b7d
Commit:     e21768928d73df55e648869d3ae159475d1e4b7d
Parent:     8c7d857c4a4a552d8d3e1b2e24e1864ec2989285
Author:     Vladimir Kondratiev <qca_vkondrat at qca.qualcomm.com>
AuthorDate: Wed Jul 25 13:56:53 2012 +0300
Committer:  Johannes Berg <johannes.berg at intel.com>
CommitDate: Tue Jul 31 16:11:01 2012 +0200

    cfg80211: unify IE search
    
    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 at qca.qualcomm.com>
    Signed-off-by: Johannes Berg <johannes.berg at intel.com>
---
 net/wireless/util.c |   18 +++---------------
 1 files changed, 3 insertions(+), 15 deletions(-)

diff --git a/net/wireless/util.c b/net/wireless/util.c
index 26f8cd3..ce393dd 100644
--- a/net/wireless/util.c
+++ b/net/wireless/util.c
@@ -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);
 



More information about the linux-mtd-cvs mailing list