Bug 194948

Summary: update for wpa_supplicant
Product: Base System Reporter: Remko Lodder <remko>
Component: kernAssignee: Adrian Chadd <adrian>
Status: Closed FIXED    
Severity: Affects Only Me CC: avos, remko
Priority: ---    
Version: CURRENT   
Hardware: Any   
OS: Any   

Description Remko Lodder freebsd_committer freebsd_triage 2014-11-11 19:52:00 UTC
As asked by adrian@ file this PR so that he can investigate this.

Author: marino
Date: Mon Oct 13 13:49:55 2014
New Revision: 370776
URL: https://svnweb.freebsd.org/changeset/ports/370776
QAT: https://qat.redports.org/buildarchive/r370776/

Log:
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.

Added:
head/security/wpa_supplicant/files/patch-src_drivers_driver__bsd.c   (contents, props changed)
Modified:
head/security/wpa_supplicant/Makefile

Modified: head/security/wpa_supplicant/Makefile
==============================================================================
--- head/security/wpa_supplicant/Makefile     Mon Oct 13 13:48:05 2014        (r370775)
+++ head/security/wpa_supplicant/Makefile     Mon Oct 13 13:49:55 2014        (r370776)
@@ -2,7 +2,7 @@

PORTNAME=     wpa_supplicant
PORTVERSION=  2.3
-PORTREVISION=        2
+PORTREVISION=        3
CATEGORIES=   security net
MASTER_SITES= http://w1.fi/releases/


Added: head/security/wpa_supplicant/files/patch-src_drivers_driver__bsd.c
==============================================================================
--- /dev/null 00:00:00 1970   (empty, because file is newly added)
+++ head/security/wpa_supplicant/files/patch-src_drivers_driver__bsd.c        Mon Oct 13 13:49:55 2014        (r370776)
@@ -0,0 +1,16 @@
+--- 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);
Comment 1 Adrian Chadd freebsd_committer freebsd_triage 2014-11-11 22:20:33 UTC
This looks fine; I wonder if it's also needed in the copy of wpa_supplicant that's in the base tree.
Comment 2 Remko Lodder freebsd_committer freebsd_triage 2014-11-25 19:33:04 UTC
Yes this is also needed in base, that was the reminder that we agreed upon :-)
Comment 3 Andriy Voskoboinyk freebsd_committer freebsd_triage 2018-12-09 12:51:09 UTC
Already included into base / ports since 2.4 update.