]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
bsd: Fix parsing of ieee80211req_scan_result on FreeBSD and DragonFly
authorImre Vadasz <imre@vdsz.com>
Tue, 6 Jan 2015 14:08:37 +0000 (15:08 +0100)
committerJouni Malinen <j@w1.fi>
Sat, 10 Jan 2015 09:43:29 +0000 (11:43 +0200)
On FreeBSD and DragonFly BSD, we additionally need to skip the
isr_meshid_len bytes of the MESH ID, to get the correct address for
copying the IE data.

The isr_meshid_len field was added in the FreeBSD svn revision r195618
in 2009, so I don't think we need to check the FreeBSD version here.

Signed-off-by: Imre Vadász <imre@vdsz.com>
src/drivers/driver_bsd.c

index c377970aad69eeb86e63930c2e45fafcfbd819b8..0f1a0f60f27d69766c9d3b166cf8e8526fdd2997 100644 (file)
@@ -1344,7 +1344,12 @@ wpa_driver_bsd_add_scan_entry(struct wpa_scan_results *res,
        *pos++ = 1;
        *pos++ = sr->isr_erp;
 
+#if defined(__DragonFly__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+       os_memcpy(pos, (u8 *)(sr + 1) + sr->isr_ssid_len + sr->isr_meshid_len,
+                 sr->isr_ie_len);
+#else
        os_memcpy(pos, (u8 *)(sr + 1) + sr->isr_ssid_len, sr->isr_ie_len);
+#endif
        pos += sr->isr_ie_len;
 
        result->ie_len = pos - (u8 *)(result + 1);