aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/bss.c
diff options
context:
space:
mode:
authorAvraham Stern <avraham.stern@intel.com>2016-02-15 14:53:17 (GMT)
committerJouni Malinen <j@w1.fi>2016-02-21 15:14:56 (GMT)
commit231b04b6cbe876006c6291a5a0cb7bfd8380f943 (patch)
tree472561be289861bf42eb3664e79734ea6bffc924 /wpa_supplicant/bss.c
parentea69d9737cfdf42610ad8134b05ecbf9daf1c289 (diff)
downloadhostap-231b04b6cbe876006c6291a5a0cb7bfd8380f943.zip
hostap-231b04b6cbe876006c6291a5a0cb7bfd8380f943.tar.gz
hostap-231b04b6cbe876006c6291a5a0cb7bfd8380f943.tar.bz2
utils: Share a single helper function to get IE by ID
Add a helper function to find a certain IE inside IEs buffer by ID and use this function in several places that implemented similar functionality locally. Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Diffstat (limited to 'wpa_supplicant/bss.c')
-rw-r--r--wpa_supplicant/bss.c15
1 files changed, 1 insertions, 14 deletions
diff --git a/wpa_supplicant/bss.c b/wpa_supplicant/bss.c
index 24cc986..a83ca10 100644
--- a/wpa_supplicant/bss.c
+++ b/wpa_supplicant/bss.c
@@ -1019,20 +1019,7 @@ struct wpa_bss * wpa_bss_get_id_range(struct wpa_supplicant *wpa_s,
*/
const u8 * wpa_bss_get_ie(const struct wpa_bss *bss, u8 ie)
{
- const u8 *end, *pos;
-
- pos = (const u8 *) (bss + 1);
- end = pos + bss->ie_len;
-
- while (end - pos > 1) {
- if (2 + pos[1] > end - pos)
- break;
- if (pos[0] == ie)
- return pos;
- pos += 2 + pos[1];
- }
-
- return NULL;
+ return get_ie((const u8 *) (bss + 1), bss->ie_len, ie);
}