diff options
Diffstat (limited to 'net/hostapd-devel')
| -rw-r--r-- | net/hostapd-devel/Makefile | 13 | ||||
| -rw-r--r-- | net/hostapd-devel/distinfo | 6 | ||||
| -rw-r--r-- | net/hostapd-devel/files/patch-src-l2_packet-l2_packet_freebsd.c | 47 | ||||
| -rw-r--r-- | net/hostapd-devel/files/patch-src_ap_hostapd.c | 31 | ||||
| -rw-r--r-- | net/hostapd-devel/files/patch-src_drivers_driver__bsd.c | 262 | ||||
| -rw-r--r-- | net/hostapd-devel/files/patch-src_l2__packet_l2__packet__freebsd.c | 14 | ||||
| -rw-r--r-- | net/hostapd-devel/files/patch-src_utils_os__unix.c | 15 |
7 files changed, 297 insertions, 91 deletions
diff --git a/net/hostapd-devel/Makefile b/net/hostapd-devel/Makefile index 7f6414c0970b..7ac12c534da2 100644 --- a/net/hostapd-devel/Makefile +++ b/net/hostapd-devel/Makefile @@ -10,19 +10,20 @@ WWW= https://w1.fi/hostapd/ USE_GITHUB= yes GH_ACCOUNT= cschuber GH_PROJECT= hostap -GH_TAGNAME= 599d00be9 -COMMIT_DATE= 2023.08.22 +GH_TAGNAME= 525bbfca3 +COMMIT_DATE= 2025.09.24 LICENSE= BSD3CLAUSE USES= cpe gmake ssl CPE_VENDOR= w1.fi BUILD_WRKSRC= ${WRKSRC}/hostapd +CFLAGS+= -Wno-incompatible-function-pointer-types CFLAGS+= -I${OPENSSLINC} LDFLAGS+= -L${OPENSSLLIB} -PLIST_FILES= sbin/hostapd sbin/hostapd_cli man/man1/hostapd_cli.1.gz \ - man/man8/hostapd.8.gz +PLIST_FILES= sbin/hostapd sbin/hostapd_cli share/man/man1/hostapd_cli.1.gz \ + share/man/man8/hostapd.8.gz .if !exists(/etc/rc.d/hostapd) USE_RC_SUBR= hostapd .endif @@ -38,8 +39,8 @@ do-install: ${INSTALL_PROGRAM} ${WRKSRC}/hostapd/hostapd_cli \ ${STAGEDIR}${PREFIX}/sbin ${INSTALL_MAN} ${WRKSRC}/hostapd/hostapd_cli.1 \ - ${STAGEDIR}${MANPREFIX}/man/man1 + ${STAGEDIR}${PREFIX}/share/man/man1 ${INSTALL_MAN} ${WRKSRC}/hostapd/hostapd.8 \ - ${STAGEDIR}${MANPREFIX}/man/man8 + ${STAGEDIR}${PREFIX}/share/man/man8 .include <bsd.port.mk> diff --git a/net/hostapd-devel/distinfo b/net/hostapd-devel/distinfo index fc397e2ed5aa..c7aee0f73caa 100644 --- a/net/hostapd-devel/distinfo +++ b/net/hostapd-devel/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1687918530 -SHA256 (cschuber-hostap-2023.08.22-599d00be9_GH0.tar.gz) = d9c1e5cd72c9fec345b43abda0f9e4d704ed4017c811f5d44e9846250d32662a -SIZE (cschuber-hostap-2023.08.22-599d00be9_GH0.tar.gz) = 5093885 +TIMESTAMP = 1758740545 +SHA256 (cschuber-hostap-2025.09.24-525bbfca3_GH0.tar.gz) = 143cd4ca7e0328b52f2bb6e220f73155b57d4633cf2042d8ca95e01b217cecc7 +SIZE (cschuber-hostap-2025.09.24-525bbfca3_GH0.tar.gz) = 5335084 diff --git a/net/hostapd-devel/files/patch-src-l2_packet-l2_packet_freebsd.c b/net/hostapd-devel/files/patch-src-l2_packet-l2_packet_freebsd.c deleted file mode 100644 index 26ecb22c808c..000000000000 --- a/net/hostapd-devel/files/patch-src-l2_packet-l2_packet_freebsd.c +++ /dev/null @@ -1,47 +0,0 @@ ---- src/l2_packet/l2_packet_freebsd.c.orig 2022-03-14 01:42:11.000000000 -0700 -+++ src/l2_packet/l2_packet_freebsd.c 2022-04-14 07:36:24.999713000 -0700 -@@ -8,7 +8,10 @@ - */ - - #include "includes.h" --#if defined(__APPLE__) || defined(__GLIBC__) -+#if defined(__FreeBSD__) \ -+ || defined(__DragonFly__) \ -+ || defined(__APPLE__) \ -+ || defined(__GLIBC__) - #include <net/bpf.h> - #endif /* __APPLE__ */ - #include <pcap.h> -@@ -76,24 +79,27 @@ - { - struct l2_packet_data *l2 = eloop_ctx; - pcap_t *pcap = sock_ctx; -- struct pcap_pkthdr hdr; -+ struct pcap_pkthdr *hdr; - const u_char *packet; - struct l2_ethhdr *ethhdr; - unsigned char *buf; - size_t len; - -- packet = pcap_next(pcap, &hdr); -+ if (pcap_next_ex(pcap, &hdr, &packet) == -1) { -+ wpa_printf(MSG_ERROR, "Error reading packet, has device disappeared?"); -+ eloop_terminate(); -+ } - -- if (!l2->rx_callback || !packet || hdr.caplen < sizeof(*ethhdr)) -+ if (!l2->rx_callback || !packet || hdr->caplen < sizeof(*ethhdr)) - return; - - ethhdr = (struct l2_ethhdr *) packet; - if (l2->l2_hdr) { - buf = (unsigned char *) ethhdr; -- len = hdr.caplen; -+ len = hdr->caplen; - } else { - buf = (unsigned char *) (ethhdr + 1); -- len = hdr.caplen - sizeof(*ethhdr); -+ len = hdr->caplen - sizeof(*ethhdr); - } - l2->rx_callback(l2->rx_callback_ctx, ethhdr->h_source, buf, len); - } diff --git a/net/hostapd-devel/files/patch-src_ap_hostapd.c b/net/hostapd-devel/files/patch-src_ap_hostapd.c new file mode 100644 index 000000000000..5219cb3a0da8 --- /dev/null +++ b/net/hostapd-devel/files/patch-src_ap_hostapd.c @@ -0,0 +1,31 @@ +--- src/ap/hostapd.c.orig 2024-02-18 01:24:29.000000000 -0800 ++++ src/ap/hostapd.c 2024-02-26 20:25:50.505205000 -0800 +@@ -2029,6 +2029,20 @@ + iface->wait_channel_update = 0; + iface->is_no_ir = false; + ++#ifdef __FreeBSD ++ /* XXX hostapd_get_hw_features() is an inline that always returns -1 ++ * because MLME will not build under FreeBSD due to its use of ++ * Linux definitions. Normally FreeBSD would uncondionally execute the ++ * "Not all drivers support..." block. Instead we #ifdef out the entire ++ * block of code instead of maintaining the fallacy that ++ * hostapd_get_hw_features() returns anything meaninful. ++ * ++ * Ideally WANT_AP_MLME should be taught about FreeBSD data structures ++ * and defintions. Instead we do this to enable channel selection in ++ * hostapd.conf. ++ */ ++ iface->freq = iface->conf->channel; ++#else + if (hostapd_get_hw_features(iface)) { + /* Not all drivers support this yet, so continue without hw + * feature data. */ +@@ -2080,6 +2094,7 @@ + if (iface->conf->ieee80211h) + wpa_printf(MSG_DEBUG, "DFS support is enabled"); + } ++#endif + return hostapd_setup_interface_complete(iface, 0); + + fail: 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 db2f4291d682..e6a3fc573aec 100644 --- a/net/hostapd-devel/files/patch-src_drivers_driver__bsd.c +++ b/net/hostapd-devel/files/patch-src_drivers_driver__bsd.c @@ -1,6 +1,12 @@ ---- src/drivers/driver_bsd.c.orig 2022-06-20 04:39:26.000000000 -0700 -+++ src/drivers/driver_bsd.c 2022-07-03 14:14:25.865828000 -0700 -@@ -14,6 +14,7 @@ +--- src/drivers/driver_bsd.c.orig 2024-07-20 11:04:37.000000000 -0700 ++++ src/drivers/driver_bsd.c 2025-04-07 12:57:12.036618000 -0700 +@@ -9,11 +9,13 @@ + + #include "includes.h" + #include <sys/ioctl.h> ++#include <sys/param.h> + + #include "common.h" #include "driver.h" #include "eloop.h" #include "common/ieee802_11_defs.h" @@ -8,7 +14,151 @@ #include "common/wpa_common.h" #include <ifaddrs.h> -@@ -853,14 +854,18 @@ +@@ -293,8 +295,9 @@ + } + + static int +-bsd_get_iface_flags(struct bsd_driver_data *drv) ++bsd_ctrl_iface(void *priv, int enable) + { ++ struct bsd_driver_data *drv = priv; + struct ifreq ifr; + + os_memset(&ifr, 0, sizeof(ifr)); +@@ -302,11 +305,38 @@ + + if (ioctl(drv->global->sock, SIOCGIFFLAGS, &ifr) < 0) { + wpa_printf(MSG_ERROR, "ioctl[SIOCGIFFLAGS]: %s", ++ strerror(errno)); ++ return -1; ++ } ++ drv->flags = ifr.ifr_flags; ++ ++ ++ if (enable) { ++ if (ifr.ifr_flags & IFF_UP) ++ goto nochange; ++ ifr.ifr_flags |= IFF_UP; ++ } else { ++ if (!(ifr.ifr_flags & IFF_UP)) ++ goto nochange; ++ ifr.ifr_flags &= ~IFF_UP; ++ } ++ ++ if (ioctl(drv->global->sock, SIOCSIFFLAGS, &ifr) < 0) { ++ wpa_printf(MSG_ERROR, "ioctl[SIOCSIFFLAGS]: %s", + strerror(errno)); + return -1; + } ++ ++ wpa_printf(MSG_DEBUG, "%s: if %s (changed) enable %d IFF_UP %d ", ++ __func__, drv->ifname, enable, ((ifr.ifr_flags & IFF_UP) != 0)); ++ + drv->flags = ifr.ifr_flags; + return 0; ++ ++nochange: ++ wpa_printf(MSG_DEBUG, "%s: if %s (no change) enable %d IFF_UP %d ", ++ __func__, drv->ifname, enable, ((ifr.ifr_flags & IFF_UP) != 0)); ++ return 0; + } + + static int +@@ -349,6 +379,20 @@ + case WPA_ALG_CCMP: + wk.ik_type = IEEE80211_CIPHER_AES_CCM; + break; ++#if defined(__FreeBSD_version) && __FreeBSD_version >= 1500027 ++ case WPA_ALG_CCMP_256: ++ wk.ik_type = IEEE80211_CIPHER_AES_CCM_256; ++ break; ++ case WPA_ALG_GCMP: ++ wk.ik_type = IEEE80211_CIPHER_AES_GCM_128; ++ break; ++ case WPA_ALG_GCMP_256: ++ wk.ik_type = IEEE80211_CIPHER_AES_GCM_256; ++ break; ++ case WPA_ALG_BIP_CMAC_128: ++ wk.ik_type = IEEE80211_CIPHER_BIP_CMAC_128; ++ break; ++#endif + default: + wpa_printf(MSG_ERROR, "%s: unknown alg=%d", __func__, alg); + return -1; +@@ -413,13 +457,34 @@ + { + #ifndef IEEE80211_IOC_APPIE + static const char *ciphernames[] = ++#if defined(__FreeBSD_version) && __FreeBSD_version >= 1500027 ++ { "WEP", "TKIP", "AES-OCB", "AES-CCM", "CKIP", "NONE", ++ "AES-CCM-256", "BIP-CMAC-128", "BIP-CMAC-256", "BIP-GMAC-128", ++ "BIP-GMAC-256", "AES-GCM-128", "AES-GCM-256" }; ++#else + { "WEP", "TKIP", "AES-OCB", "AES-CCM", "CKIP", "NONE" }; ++#endif ++ + int v; + + switch (params->wpa_group) { + case WPA_CIPHER_CCMP: + v = IEEE80211_CIPHER_AES_CCM; + break; ++#if defined(__FreeBSD_version) && __FreeBSD_version >= 1500027 ++ case WPA_CIPHER_CCMP_256: ++ v = IEEE80211_CIPHER_AES_CCM_256; ++ break; ++ case WPA_CIPHER_GCMP: ++ v = IEEE80211_CIPHER_AES_GCM_128; ++ break; ++ case WPA_CIPHER_GCMP_256: ++ v = IEEE80211_CIPHER_AES_GCM_256; ++ break; ++ case WPA_CIPHER_BIP_CMAC_128: ++ v = IEEE80211_CIPHER_BIP_CMAC_128; ++ break; ++#endif + case WPA_CIPHER_TKIP: + v = IEEE80211_CIPHER_TKIP; + break; +@@ -456,8 +521,20 @@ + } + + v = 0; ++#if defined(__FreeBSD_version) && __FreeBSD_version >= 1500027 ++ if (params->wpa_pairwise & WPA_CIPHER_BIP_CMAC_128) ++ v |= 1<<IEEE80211_CIPHER_BIP_CMAC_128; ++ if (params->wpa_pairwise & WPA_CIPHER_GCMP) ++ v |= 1<<IEEE80211_CIPHER_AES_GCM_128; ++ if (params->wpa_pairwise & WPA_CIPHER_GCMP_256) ++ v |= 1<<IEEE80211_CIPHER_AES_GCM_256; ++#endif + if (params->wpa_pairwise & WPA_CIPHER_CCMP) + v |= 1<<IEEE80211_CIPHER_AES_CCM; ++#if defined(__FreeBSD_version) && __FreeBSD_version >= 1500027 ++ if (params->wpa_pairwise & WPA_CIPHER_CCMP_256) ++ v |= 1<<IEEE80211_CIPHER_AES_CCM_256; ++#endif + if (params->wpa_pairwise & WPA_CIPHER_TKIP) + v |= 1<<IEEE80211_CIPHER_TKIP; + if (params->wpa_pairwise & WPA_CIPHER_NONE) +@@ -525,7 +602,7 @@ + __func__); + return -1; + } +- return 0; ++ return bsd_ctrl_iface(priv, 1); + } + + static void +@@ -586,6 +663,7 @@ + mode = IFM_IEEE80211_11B; + } else { + mode = ++ freq->vht_enabled ? IFM_IEEE80211_VHT5G : + freq->ht_enabled ? IFM_IEEE80211_11NA : + IFM_IEEE80211_11A; + } +@@ -853,14 +931,18 @@ drv = bsd_get_drvindex(global, ifm->ifm_index); if (drv == NULL) return; @@ -30,7 +180,32 @@ wpa_printf(MSG_DEBUG, "RTM_IFINFO: Interface '%s' UP", drv->ifname); wpa_supplicant_event(drv->ctx, EVENT_INTERFACE_ENABLED, -@@ -1197,13 +1202,41 @@ +@@ -1027,7 +1109,8 @@ + if (l2_packet_get_own_addr(drv->sock_xmit, params->own_addr)) + goto bad; + +- if (bsd_get_iface_flags(drv) < 0) ++ /* mark down during setup */ ++ if (bsd_ctrl_iface(drv, 0) < 0) + goto bad; + + if (bsd_set_mediaopt(drv, IFM_OMASK, IFM_IEEE80211_HOSTAP) < 0) { +@@ -1052,12 +1135,13 @@ + { + struct bsd_driver_data *drv = priv; + ++ if (drv->ifindex != 0) ++ bsd_ctrl_iface(drv, 0); + if (drv->sock_xmit != NULL) + l2_packet_deinit(drv->sock_xmit); + os_free(drv); + } + +- + static int + bsd_set_sta_authorized(void *priv, const u8 *addr, + unsigned int total_flags, unsigned int flags_or, +@@ -1199,13 +1283,41 @@ } static int @@ -73,7 +248,7 @@ wpa_printf(MSG_DEBUG, "%s: ssid '%.*s' wpa ie len %u pairwise %u group %u key mgmt %u" -@@ -1220,7 +1253,10 @@ +@@ -1222,7 +1334,10 @@ mode = 0 /* STA */; break; case IEEE80211_MODE_IBSS: @@ -84,7 +259,7 @@ break; case IEEE80211_MODE_AP: mode = IFM_IEEE80211_HOSTAP; -@@ -1249,24 +1285,33 @@ +@@ -1251,22 +1366,31 @@ ret = -1; if (wpa_driver_bsd_set_auth_alg(drv, params->auth_alg) < 0) ret = -1; @@ -97,6 +272,9 @@ - params->key_mgmt_suite == WPA_KEY_MGMT_NONE && - params->wpa_ie_len == 0); - wpa_printf(MSG_DEBUG, "%s: set PRIVACY %u", __func__, privacy); +- +- if (set80211param(drv, IEEE80211_IOC_PRIVACY, privacy) < 0) +- return -1; + if (params->wpa_ie_len) { + rsn_ie = get_ie(params->wpa_ie, params->wpa_ie_len, + WLAN_EID_RSN); @@ -116,49 +294,44 @@ + } + } -- if (set80211param(drv, IEEE80211_IOC_PRIVACY, privacy) < 0) +- if (params->wpa_ie_len && +- set80211param(drv, IEEE80211_IOC_WPA, +- params->wpa_ie[0] == WLAN_EID_RSN ? 2 : 1) < 0) + /* + * NB: interface must be marked UP for association + * or scanning (ap_scan=2) + */ -+ if (bsd_get_iface_flags(drv) < 0) ++ if (bsd_ctrl_iface(drv, 1) < 0) return -1; -- if (params->wpa_ie_len && -- set80211param(drv, IEEE80211_IOC_WPA, -- params->wpa_ie[0] == WLAN_EID_RSN ? 2 : 1) < 0) -- return -1; -- os_memset(&mlme, 0, sizeof(mlme)); - mlme.im_op = IEEE80211_MLME_ASSOC; - if (params->ssid != NULL) -@@ -1485,6 +1530,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. -+ */ +@@ -1311,11 +1435,8 @@ + } + + /* NB: interface must be marked UP to do a scan */ +- if (!(drv->flags & IFF_UP)) { +- wpa_printf(MSG_DEBUG, "%s: interface is not up, cannot scan", +- __func__); ++ if (bsd_ctrl_iface(drv, 1) < 0) + return -1; +- } - if (devcaps.dc_cryptocaps & IEEE80211_CRYPTO_WEP) - drv->capa.enc |= WPA_DRIVER_CAPA_ENC_WEP40 | -@@ -1493,6 +1549,7 @@ + #ifdef IEEE80211_IOC_SCAN_MAX_SSID + os_memset(&sr, 0, sizeof(sr)); +@@ -1495,6 +1616,12 @@ drv->capa.enc |= WPA_DRIVER_CAPA_ENC_TKIP; if (devcaps.dc_cryptocaps & IEEE80211_CRYPTO_AES_CCM) drv->capa.enc |= WPA_DRIVER_CAPA_ENC_CCMP; ++#if defined(__FreeBSD_version) && __FreeBSD_version >= 1500027 ++ if (devcaps.dc_cryptocaps & IEEE80211_CRYPTO_AES_GCM_128) ++ drv->capa.enc |= WPA_DRIVER_CAPA_ENC_GCMP; ++ if (devcaps.dc_cryptocaps & IEEE80211_CRYPTO_BIP_CMAC_128) ++ drv->capa.enc |= WPA_DRIVER_CAPA_ENC_BIP; +#endif if (devcaps.dc_drivercaps & IEEE80211_C_HOSTAP) drv->capa.flags |= WPA_DRIVER_FLAGS_AP; -@@ -1545,6 +1602,8 @@ +@@ -1547,6 +1674,8 @@ } if (ifmr.ifm_current & IFM_IEEE80211_HOSTAP) return IEEE80211_M_HOSTAP; @@ -167,3 +340,22 @@ if (ifmr.ifm_current & IFM_IEEE80211_MONITOR) return IEEE80211_M_MONITOR; #ifdef IEEE80211_M_MBSS +@@ -1607,7 +1736,7 @@ + drv->capa.key_mgmt_iftype[i] = drv->capa.key_mgmt; + + /* Down interface during setup. */ +- if (bsd_get_iface_flags(drv) < 0) ++ if (bsd_ctrl_iface(drv, 0) < 0) + goto fail; + + /* Proven to work, lets go! */ +@@ -1631,6 +1760,9 @@ + if (drv->ifindex != 0 && !drv->if_removed) { + wpa_driver_bsd_set_wpa(drv, 0); + ++ /* NB: mark interface down */ ++ bsd_ctrl_iface(drv, 0); ++ + wpa_driver_bsd_set_wpa_internal(drv, drv->prev_wpa, + drv->prev_privacy); + diff --git a/net/hostapd-devel/files/patch-src_l2__packet_l2__packet__freebsd.c b/net/hostapd-devel/files/patch-src_l2__packet_l2__packet__freebsd.c new file mode 100644 index 000000000000..2ec52fcdcd85 --- /dev/null +++ b/net/hostapd-devel/files/patch-src_l2__packet_l2__packet__freebsd.c @@ -0,0 +1,14 @@ +--- src/l2_packet/l2_packet_freebsd.c.orig 2023-10-30 10:53:18.000000000 -0700 ++++ src/l2_packet/l2_packet_freebsd.c 2023-10-30 14:10:36.396969000 -0700 +@@ -8,7 +8,10 @@ + */ + + #include "includes.h" +-#if defined(__APPLE__) || defined(__GLIBC__) ++#if defined(__FreeBSD__) \ ++ || defined(__DragonFly__) \ ++ || defined(__APPLE__) \ ++ || defined(__GLIBC__) + #include <net/bpf.h> + #endif /* __APPLE__ */ + #include <pcap.h> diff --git a/net/hostapd-devel/files/patch-src_utils_os__unix.c b/net/hostapd-devel/files/patch-src_utils_os__unix.c new file mode 100644 index 000000000000..140db6151f76 --- /dev/null +++ b/net/hostapd-devel/files/patch-src_utils_os__unix.c @@ -0,0 +1,15 @@ +--- src/utils/os_unix.c.orig 2024-05-10 09:57:55.000000000 -0700 ++++ src/utils/os_unix.c 2024-06-01 22:28:22.467129000 -0700 +@@ -103,10 +103,12 @@ + break; + #endif + #ifdef CLOCK_MONOTONIC ++#if !(defined(CLOCK_BOOTTIME) && CLOCK_BOOTTIME == CLOCK_MONOTONIC) + case CLOCK_MONOTONIC: + clock_id = CLOCK_REALTIME; + break; + #endif ++#endif + case CLOCK_REALTIME: + return -1; + } |
