Skip to content

Commit

Permalink
cfg80211: unify IE search
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Vladimir Kondratiev authored and Johannes Berg committed Jul 31, 2012
1 parent 8c7d857 commit e217689
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions net/wireless/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit e217689

Please sign in to comment.