From: Eliad Peller Date: Thu, 27 Oct 2016 12:18:26 +0000 (+0300) Subject: wpa_supplicant: Get scan_result IE also from Beacon frames X-Git-Tag: hostap_2_7~2147 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d044d2f7d81a5e1456bd9385257c858f10fcaad8;p=thirdparty%2Fhostap.git wpa_supplicant: Get scan_result IE also from Beacon frames No reason to require ie_len if only beacon_ie_len is given. Signed-off-by: Eliad Peller --- diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c index bfde0af1f..172772de6 100644 --- a/wpa_supplicant/scan.c +++ b/wpa_supplicant/scan.c @@ -1618,7 +1618,13 @@ static int wpa_scan_get_max_rate(const struct wpa_scan_res *res) */ const u8 * wpa_scan_get_ie(const struct wpa_scan_res *res, u8 ie) { - return get_ie((const u8 *) (res + 1), res->ie_len, ie); + size_t ie_len = res->ie_len; + + /* Use the Beacon frame IEs if res->ie_len is not available */ + if (!ie_len) + ie_len = res->beacon_ie_len; + + return get_ie((const u8 *) (res + 1), ie_len, ie); }