[PATCH] bsd: Fix parsing of ieee80211req_scan_result on FreeBSD and DragonFly.

Imre Vadasz imre
Tue Jan 6 06:00:09 PST 2015


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 at vdsz.com>
---
 src/drivers/driver_bsd.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/drivers/driver_bsd.c b/src/drivers/driver_bsd.c
index c377970..086fece 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);
-- 
2.1.2




More information about the Hostap mailing list