diff --git a/net/hostapd-devel/Makefile b/net/hostapd-devel/Makefile index 5e4a2bf8feea..06df1ba11977 100644 --- a/net/hostapd-devel/Makefile +++ b/net/hostapd-devel/Makefile @@ -1,46 +1,46 @@ PORTNAME= hostapd PORTVERSION= ${COMMIT_DATE} -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= net PKGNAMESUFFIX= -devel MAINTAINER= cy@FreeBSD.org COMMENT= IEEE 802.11 AP, IEEE 802.1X/WPA/WPA2/EAP/RADIUS Authenticator WWW= https://w1.fi/hostapd/ USE_GITHUB= yes GH_ACCOUNT= cschuber GH_PROJECT= hostap GH_TAGNAME= b46c4b9a9 COMMIT_DATE= 2023.09.05 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 man/man1/hostapd_cli.1.gz \ 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}${MANPREFIX}/man/man1 ${INSTALL_MAN} ${WRKSRC}/hostapd/hostapd.8 \ ${STAGEDIR}${MANPREFIX}/man/man8 .include 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 index 26ecb22c808c..224ca67ee95f 100644 --- 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 @@ -1,47 +1,48 @@ ---- 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 +--- src/l2_packet/l2_packet_freebsd.c.orig 2023-09-05 10:38:47.000000000 -0700 ++++ src/l2_packet/l2_packet_freebsd.c 2023-09-11 22:12:22.076149000 -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 -@@ -76,24 +79,27 @@ +@@ -76,24 +79,28 @@ { 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); } l2->rx_callback(l2->rx_callback_ctx, ethhdr->h_source, buf, len); }