aboutsummaryrefslogtreecommitdiffstats
path: root/src/drivers/driver_bsd.c
diff options
context:
space:
mode:
authorImre Vadasz <imre@vdsz.com>2015-01-06 14:08:37 (GMT)
committerJouni Malinen <j@w1.fi>2015-01-10 09:43:29 (GMT)
commit28c91ee1242755687c722ef883ad00efc74fae0a (patch)
tree4299f5893180f8c15f140e10a0dfee06eb97ae3b /src/drivers/driver_bsd.c
parent96d1d97af6fb5ba0b5eba6769e80d2af7e7d4539 (diff)
downloadhostap-28c91ee1242755687c722ef883ad00efc74fae0a.zip
hostap-28c91ee1242755687c722ef883ad00efc74fae0a.tar.gz
hostap-28c91ee1242755687c722ef883ad00efc74fae0a.tar.bz2
bsd: Fix parsing of ieee80211req_scan_result on FreeBSD and DragonFly
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>
Diffstat (limited to 'src/drivers/driver_bsd.c')
-rw-r--r--src/drivers/driver_bsd.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/drivers/driver_bsd.c b/src/drivers/driver_bsd.c
index c377970..0f1a0f6 100644
--- a/src/drivers/driver_bsd.c
+++ b/src/drivers/driver_bsd.c
@@ -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);