diff --git a/net/hostapd-devel/Makefile b/net/hostapd-devel/Makefile index 95aeb3ceb624..e7a5a3f7d11a 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= 86c242171 COMMIT_DATE= 2024.02.18 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-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/Makefile b/net/hostapd/Makefile index 4ff64eacad26..a9a1aebc0a0d 100644 --- a/net/hostapd/Makefile +++ b/net/hostapd/Makefile @@ -1,40 +1,40 @@ PORTNAME= hostapd PORTVERSION= 2.10 -PORTREVISION= 9 +PORTREVISION= 10 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/files/patch-src_ap_hostapd.c b/net/hostapd/files/patch-src_ap_hostapd.c new file mode 100644 index 000000000000..1eafe68ad485 --- /dev/null +++ b/net/hostapd/files/patch-src_ap_hostapd.c @@ -0,0 +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 @@ + { + iface->wait_channel_update = 0; + ++#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 @@ + if (iface->conf->ieee80211h) + wpa_printf(MSG_DEBUG, "DFS support is enabled"); + } ++#endif + return hostapd_setup_interface_complete(iface, 0); + + fail: