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>
This commit is contained in:
Imre Vadasz 2015-01-06 15:08:37 +01:00 committed by Jouni Malinen
parent 96d1d97af6
commit 28c91ee124

View file

@ -1344,7 +1344,12 @@ wpa_driver_bsd_add_scan_entry(struct wpa_scan_results *res,
*pos++ = 1; *pos++ = 1;
*pos++ = sr->isr_erp; *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); os_memcpy(pos, (u8 *)(sr + 1) + sr->isr_ssid_len, sr->isr_ie_len);
#endif
pos += sr->isr_ie_len; pos += sr->isr_ie_len;
result->ie_len = pos - (u8 *)(result + 1); result->ie_len = pos - (u8 *)(result + 1);