ports/security/wpa_supplicant/files/patch-src_drivers_driver__bsd.c
John Marino 61f267d59a security/wpa_supplicant: Bring in BSD driver fix from DragonFly BSD
DragonFly adopted it's "new" IEEE 802.11 infrastructure from FreeBSD.
This introduced an additional isr_meshid_len field in the
ieee80211req_scan_result structure.  It is necessary to include this
additional offset when calculating the address of the IE data buffer.

Imre Vadasz introduced this fix to DragonFly on 01 Sept 2014, but a
similar fix doesn't appear to be present in FreeBSD's base wpa_supplicant.
2014-10-13 13:49:55 +00:00

16 lines
527 B
C

--- src/drivers/driver_bsd.c.orig 2014-10-09 14:41:31 UTC
+++ src/drivers/driver_bsd.c
@@ -1334,7 +1334,13 @@ wpa_driver_bsd_add_scan_entry(struct wpa
*pos++ = 1;
*pos++ = sr->isr_erp;
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) \
+ || defined(__DragonFly__)
+ 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);