summaryrefslogtreecommitdiff
path: root/net/hostapd-devel
diff options
context:
space:
mode:
authorCy Schubert <cy@FreeBSD.org>2022-06-20 07:25:42 -0700
committerCy Schubert <cy@FreeBSD.org>2022-06-20 07:29:09 -0700
commit05a849eec9d949b3de32e464570cefbabcd64702 (patch)
treed766869759ca7dc9ade17aa756b24f4799d2dcdb /net/hostapd-devel
parentf93d5107c000ecf9f07756ebfaaa173cae4c1ef8 (diff)
downloadfreebsd-ports-05a849eec9d949b3de32e464570cefbabcd64702.zip
*/*: Restore a missing wpa BSD driver patch
These patches were removed to sync with base where in fact base was missing these patches and base should have been synced with the ports. PR: 264238 Fixes: b8477825c2dc42f6c595697a36f593c71f39fbad c86f32d652eb9dd023049122d8ca37cb13ed07b6 MFH: 2022Q2
Diffstat (limited to 'net/hostapd-devel')
-rw-r--r--net/hostapd-devel/Makefile2
-rw-r--r--net/hostapd-devel/files/patch-src_drivers_driver__bsd.c65
2 files changed, 64 insertions, 3 deletions
diff --git a/net/hostapd-devel/Makefile b/net/hostapd-devel/Makefile
index e3e48c5dc457..907873af49a0 100644
--- a/net/hostapd-devel/Makefile
+++ b/net/hostapd-devel/Makefile
@@ -2,7 +2,7 @@
PORTNAME= hostapd
PORTVERSION= ${COMMIT_DATE}
-PORTREVISION= 2
+PORTREVISION= 3
CATEGORIES= net
PKGNAMESUFFIX= -devel
diff --git a/net/hostapd-devel/files/patch-src_drivers_driver__bsd.c b/net/hostapd-devel/files/patch-src_drivers_driver__bsd.c
index f56c30c30ad3..dda055f26664 100644
--- a/net/hostapd-devel/files/patch-src_drivers_driver__bsd.c
+++ b/net/hostapd-devel/files/patch-src_drivers_driver__bsd.c
@@ -1,5 +1,5 @@
---- src/drivers/driver_bsd.c.orig 2021-06-02 14:11:18.000000000 -0700
-+++ src/drivers/driver_bsd.c 2021-06-13 23:11:15.089256000 -0700
+--- src/drivers/driver_bsd.c.orig 2022-05-24 13:30:39.000000000 -0700
++++ src/drivers/driver_bsd.c 2022-06-20 07:18:14.191871000 -0700
@@ -853,14 +853,18 @@
drv = bsd_get_drvindex(global, ifm->ifm_index);
if (drv == NULL)
@@ -21,3 +21,64 @@
+ (drv->flags & IFF_RUNNING) == 0)) {
wpa_printf(MSG_DEBUG, "RTM_IFINFO: Interface '%s' UP",
drv->ifname);
+ wpa_supplicant_event(drv->ctx, EVENT_INTERFACE_ENABLED,
+@@ -1220,7 +1224,10 @@
+ mode = 0 /* STA */;
+ break;
+ case IEEE80211_MODE_IBSS:
++#if 0
+ mode = IFM_IEEE80211_IBSS;
++#endif
++ mode = IFM_IEEE80211_ADHOC;
+ break;
+ case IEEE80211_MODE_AP:
+ mode = IFM_IEEE80211_HOSTAP;
+@@ -1267,6 +1274,13 @@
+ params->wpa_ie[0] == WLAN_EID_RSN ? 2 : 1) < 0)
+ return -1;
+
++ /*
++ * NB: interface must be marked UP for association
++ * or scanning (ap_scan=2)
++ */
++ if (bsd_get_iface_flags(drv) < 0)
++ return -1;
++
+ os_memset(&mlme, 0, sizeof(mlme));
+ mlme.im_op = IEEE80211_MLME_ASSOC;
+ if (params->ssid != NULL)
+@@ -1485,6 +1499,17 @@
+ if (devcaps.dc_drivercaps & IEEE80211_C_WPA2)
+ drv->capa.key_mgmt = WPA_DRIVER_CAPA_KEY_MGMT_WPA2 |
+ WPA_DRIVER_CAPA_KEY_MGMT_WPA2_PSK;
++#ifdef __FreeBSD__
++ drv->capa.enc |= WPA_DRIVER_CAPA_ENC_WEP40 |
++ WPA_DRIVER_CAPA_ENC_WEP104 |
++ WPA_DRIVER_CAPA_ENC_TKIP |
++ WPA_DRIVER_CAPA_ENC_CCMP;
++#else
++ /*
++ * XXX
++ * FreeBSD exports hardware cryptocaps. These have no meaning for wpa
++ * since net80211 performs software crypto.
++ */
+
+ if (devcaps.dc_cryptocaps & IEEE80211_CRYPTO_WEP)
+ drv->capa.enc |= WPA_DRIVER_CAPA_ENC_WEP40 |
+@@ -1493,6 +1518,7 @@
+ drv->capa.enc |= WPA_DRIVER_CAPA_ENC_TKIP;
+ if (devcaps.dc_cryptocaps & IEEE80211_CRYPTO_AES_CCM)
+ drv->capa.enc |= WPA_DRIVER_CAPA_ENC_CCMP;
++#endif
+
+ if (devcaps.dc_drivercaps & IEEE80211_C_HOSTAP)
+ drv->capa.flags |= WPA_DRIVER_FLAGS_AP;
+@@ -1545,6 +1571,8 @@
+ }
+ if (ifmr.ifm_current & IFM_IEEE80211_HOSTAP)
+ return IEEE80211_M_HOSTAP;
++ if (ifmr.ifm_current & IFM_IEEE80211_IBSS)
++ return IEEE80211_M_IBSS;
+ if (ifmr.ifm_current & IFM_IEEE80211_MONITOR)
+ return IEEE80211_M_MONITOR;
+ #ifdef IEEE80211_M_MBSS