diff --git a/net/hostapd/Makefile b/net/hostapd/Makefile index a9a1aebc0a0d..800a69ace4b8 100644 --- a/net/hostapd/Makefile +++ b/net/hostapd/Makefile @@ -1,40 +1,39 @@ PORTNAME= hostapd -PORTVERSION= 2.10 -PORTREVISION= 10 +PORTVERSION= 2.11 CATEGORIES= net MASTER_SITES= https://w1.fi/releases/ MAINTAINER= cy@FreeBSD.org COMMENT= IEEE 802.11 AP, IEEE 802.1X/WPA/WPA2/EAP/RADIUS Authenticator WWW= https://w1.fi/hostapd/ LICENSE= BSD3CLAUSE USES= cpe gmake ssl CPE_VENDOR= w1.fi BUILD_WRKSRC= ${WRKSRC}/hostapd CFLAGS+= -I${OPENSSLINC} LDFLAGS+= -L${OPENSSLLIB} 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 post-patch: @${REINPLACE_CMD} -e 's|@$$(E) " CC " $$<|@$$(E) " $$(CC) " $$<|' \ ${BUILD_WRKSRC}/Makefile @${SED} -e 's|@PREFIX@|${PREFIX}|g' ${FILESDIR}/config \ >> ${WRKSRC}/hostapd/.config do-install: ${INSTALL_PROGRAM} ${WRKSRC}/hostapd/hostapd ${STAGEDIR}${PREFIX}/sbin ${INSTALL_PROGRAM} ${WRKSRC}/hostapd/hostapd_cli \ ${STAGEDIR}${PREFIX}/sbin ${INSTALL_MAN} ${WRKSRC}/hostapd/hostapd_cli.1 \ ${STAGEDIR}${PREFIX}/share/man/man1 ${INSTALL_MAN} ${WRKSRC}/hostapd/hostapd.8 \ ${STAGEDIR}${PREFIX}/share/man/man8 .include diff --git a/net/hostapd/distinfo b/net/hostapd/distinfo index 784e7e6d9238..9034618f0bb4 100644 --- a/net/hostapd/distinfo +++ b/net/hostapd/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1642436112 -SHA256 (hostapd-2.10.tar.gz) = 206e7c799b678572c2e3d12030238784bc4a9f82323b0156b4c9466f1498915d -SIZE (hostapd-2.10.tar.gz) = 2440435 +TIMESTAMP = 1721564130 +SHA256 (hostapd-2.11.tar.gz) = 2b3facb632fd4f65e32f4bf82a76b4b72c501f995a4f62e330219fe7aed1747a +SIZE (hostapd-2.11.tar.gz) = 2708343 diff --git a/net/hostapd/files/patch-src_ap_hostapd.c b/net/hostapd/files/patch-src_ap_hostapd.c index 1eafe68ad485..5219cb3a0da8 100644 --- a/net/hostapd/files/patch-src_ap_hostapd.c +++ b/net/hostapd/files/patch-src_ap_hostapd.c @@ -1,31 +1,31 @@ ---- src/ap/hostapd.c.orig 2022-01-16 12:51:29.000000000 -0800 -+++ src/ap/hostapd.c 2024-02-26 20:24:39.350068000 -0800 -@@ -1698,6 +1698,20 @@ - { +--- 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. */ -@@ -1744,6 +1758,7 @@ +@@ -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/files/patch-src_l2__packet_l2__packet__freebsd.c b/net/hostapd/files/patch-src_l2__packet_l2__packet__freebsd.c index e0aa170fa91f..2ec52fcdcd85 100644 --- a/net/hostapd/files/patch-src_l2__packet_l2__packet__freebsd.c +++ b/net/hostapd/files/patch-src_l2__packet_l2__packet__freebsd.c @@ -1,74 +1,14 @@ ---- src/l2_packet/l2_packet_freebsd.c.orig 2022-01-16 12:51:29.000000000 -0800 -+++ src/l2_packet/l2_packet_freebsd.c 2023-09-11 22:21:12.054042000 -0700 +--- 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 #endif /* __APPLE__ */ #include -@@ -20,6 +23,7 @@ - #include - #endif /* __sun__ */ - -+#include - #include - #include - #include -@@ -76,24 +80,33 @@ - { - 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?"); -+ packet = NULL; -+ 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); -+ /* handle 8021Q encapsulated frames */ -+ if (ethhdr->h_proto == htons(ETH_P_8021Q)) { -+ buf += ETHER_VLAN_ENCAP_LEN; -+ len -= ETHER_VLAN_ENCAP_LEN; -+ } - } - l2->rx_callback(l2->rx_callback_ctx, ethhdr->h_source, buf, len); - } -@@ -122,10 +135,10 @@ - os_snprintf(pcap_filter, sizeof(pcap_filter), - "not ether src " MACSTR " and " - "( ether dst " MACSTR " or ether dst " MACSTR " ) and " -- "ether proto 0x%x", -+ "( ether proto 0x%x or ( vlan 0 and ether proto 0x%x ) )", - MAC2STR(l2->own_addr), /* do not receive own packets */ - MAC2STR(l2->own_addr), MAC2STR(pae_group_addr), -- protocol); -+ protocol, protocol); - if (pcap_compile(l2->pcap, &pcap_fp, pcap_filter, 1, pcap_netp) < 0) { - fprintf(stderr, "pcap_compile: %s\n", pcap_geterr(l2->pcap)); - return -1; diff --git a/net/hostapd/files/patch-src_utils_os__unix.c b/net/hostapd/files/patch-src_utils_os__unix.c index 860682df6e05..140db6151f76 100644 --- a/net/hostapd/files/patch-src_utils_os__unix.c +++ b/net/hostapd/files/patch-src_utils_os__unix.c @@ -1,15 +1,15 @@ ---- src/utils/os_unix.c.orig 2022-01-16 12:51:29.000000000 -0800 -+++ src/utils/os_unix.c 2024-06-01 22:20:49.333716000 -0700 +--- 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; }