From a15995819a27bee9285a0a3c3a6c853d1e9af680 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sun, 21 Feb 2016 17:07:47 +0200 Subject: [PATCH] ndis: Use the new get_ie() helper to avoid duplicated code This removes more duplicated implementation of finding the first IE based on the id. Signed-off-by: Jouni Malinen --- src/drivers/driver_ndis.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/src/drivers/driver_ndis.c b/src/drivers/driver_ndis.c index fd32134c7..9440f0127 100644 --- a/src/drivers/driver_ndis.c +++ b/src/drivers/driver_ndis.c @@ -35,6 +35,7 @@ int close(int fd); #include "driver.h" #include "eloop.h" #include "common/ieee802_11_defs.h" +#include "common/ieee802_11_common.h" #include "driver_ndis.h" int wpa_driver_register_event_cb(struct wpa_driver_ndis_data *drv); @@ -780,20 +781,7 @@ static int wpa_driver_ndis_scan(void *priv, static const u8 * wpa_scan_get_ie(const struct wpa_scan_res *res, u8 ie) { - const u8 *end, *pos; - - pos = (const u8 *) (res + 1); - end = pos + res->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 *) (res + 1), res->ie_len, ie); }