]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
wpa_supplicant: Get scan_result IE also from Beacon frames
authorEliad Peller <eliad@wizery.com>
Thu, 27 Oct 2016 12:18:26 +0000 (15:18 +0300)
committerJouni Malinen <j@w1.fi>
Sat, 29 Oct 2016 16:28:37 +0000 (19:28 +0300)
No reason to require ie_len if only beacon_ie_len is given.

Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
wpa_supplicant/scan.c

index bfde0af1f0366d3ca8ae61a806c3460ec6e7a190..172772de6f4e370cd3650584c416ff351634ae47 100644 (file)
@@ -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);
 }