git: f5e549a9f44e - main - net/hostapd: Update to 2.10

From: Cy Schubert <cy_at_FreeBSD.org>
Date: Mon, 17 Jan 2022 17:01:09 UTC
The branch main has been updated by cy:

URL: https://cgit.FreeBSD.org/ports/commit/?id=f5e549a9f44e992c0a2f34b2f7686198f5590bad

commit f5e549a9f44e992c0a2f34b2f7686198f5590bad
Author:     Cy Schubert <cy@FreeBSD.org>
AuthorDate: 2022-01-17 16:15:43 +0000
Commit:     Cy Schubert <cy@FreeBSD.org>
CommitDate: 2022-01-17 17:00:45 +0000

    net/hostapd: Update to 2.10
    
    The long awaited hostapd 2.10 is finally here.
---
 net/hostapd/Makefile                              |  8 +---
 net/hostapd/distinfo                              | 12 ++---
 net/hostapd/files/patch-src_drivers_driver__bsd.c | 57 +++++++----------------
 net/hostapd/files/patch-src_utils_os__unix.c      | 18 -------
 net/hostapd/files/patch-src_wps_wps__upnp.c       | 20 +++-----
 5 files changed, 28 insertions(+), 87 deletions(-)

diff --git a/net/hostapd/Makefile b/net/hostapd/Makefile
index a87a8ed33515..97e774f07b94 100644
--- a/net/hostapd/Makefile
+++ b/net/hostapd/Makefile
@@ -1,16 +1,10 @@
 # Created by: Craig Leres <leres@FreeBSD.org>
 
 PORTNAME=	hostapd
-PORTVERSION=	2.9
-PORTREVISION=	4
+PORTVERSION=	2.10
 CATEGORIES=	net
 MASTER_SITES=	https://w1.fi/releases/
 
-PATCH_SITES=	https://w1.fi/security/2020-1/
-PATCHFILES=	0001-WPS-UPnP-Do-not-allow-event-subscriptions-with-URLs-.patch:-p1 \
-		0002-WPS-UPnP-Fix-event-message-generation-using-a-long-U.patch:-p1 \
-		0003-WPS-UPnP-Handle-HTTP-initiation-failures-for-events-.patch:-p1
-
 MAINTAINER=	cy@FreeBSD.org
 COMMENT=	IEEE 802.11 AP, IEEE 802.1X/WPA/WPA2/EAP/RADIUS Authenticator
 
diff --git a/net/hostapd/distinfo b/net/hostapd/distinfo
index c6fd159e26c4..784e7e6d9238 100644
--- a/net/hostapd/distinfo
+++ b/net/hostapd/distinfo
@@ -1,9 +1,3 @@
-TIMESTAMP = 1591652140
-SHA256 (hostapd-2.9.tar.gz) = 881d7d6a90b2428479288d64233151448f8990ab4958e0ecaca7eeb3c9db2bd7
-SIZE (hostapd-2.9.tar.gz) = 2244312
-SHA256 (0001-WPS-UPnP-Do-not-allow-event-subscriptions-with-URLs-.patch) = 2d9a5b9d616f1b4aa4a22b967cee866e2f69b798b0b46803a7928c8559842bd7
-SIZE (0001-WPS-UPnP-Do-not-allow-event-subscriptions-with-URLs-.patch) = 5909
-SHA256 (0002-WPS-UPnP-Fix-event-message-generation-using-a-long-U.patch) = 49feb35a5276279b465f6836d6fa2c6b34d94dc979e8b840d1918865c04260de
-SIZE (0002-WPS-UPnP-Fix-event-message-generation-using-a-long-U.patch) = 2284
-SHA256 (0003-WPS-UPnP-Handle-HTTP-initiation-failures-for-events-.patch) = a8212a2d89a5bab2824d22b6047e7740553df163114fcec94832bfa9c5c5d78a
-SIZE (0003-WPS-UPnP-Handle-HTTP-initiation-failures-for-events-.patch) = 1553
+TIMESTAMP = 1642436112
+SHA256 (hostapd-2.10.tar.gz) = 206e7c799b678572c2e3d12030238784bc4a9f82323b0156b4c9466f1498915d
+SIZE (hostapd-2.10.tar.gz) = 2440435
diff --git a/net/hostapd/files/patch-src_drivers_driver__bsd.c b/net/hostapd/files/patch-src_drivers_driver__bsd.c
index fe3064586710..9a37a1de0174 100644
--- a/net/hostapd/files/patch-src_drivers_driver__bsd.c
+++ b/net/hostapd/files/patch-src_drivers_driver__bsd.c
@@ -1,42 +1,6 @@
---- src/drivers/driver_bsd.c.orig	2019-08-07 06:25:25.000000000 -0700
-+++ src/drivers/driver_bsd.c	2021-06-13 23:10:12.570253000 -0700
-@@ -649,7 +649,7 @@
- 		len = 2048;
- 	}
- 
--	return len;
-+	return (len == 0) ? 2048 : len;
- }
- 
- #ifdef HOSTAPD
-@@ -665,7 +665,11 @@
- static int bsd_sta_deauth(void *priv, const u8 *own_addr, const u8 *addr,
- 			  u16 reason_code);
- 
-+#ifdef __DragonFly__
-+const char *
-+#else
- static const char *
-+#endif
- ether_sprintf(const u8 *addr)
- {
- 	static char buf[sizeof(MACSTR)];
-@@ -1080,7 +1084,14 @@
- 		mode = 0 /* STA */;
- 		break;
- 	case IEEE80211_MODE_IBSS:
-+		/*
-+		 * Ref bin/203086 - FreeBSD's net80211 currently uses
-+		 * IFM_IEEE80211_ADHOC.
-+		 */
-+#if 0
- 		mode = IFM_IEEE80211_IBSS;
-+#endif
-+		mode = IFM_IEEE80211_ADHOC;
- 		break;
- 	case IEEE80211_MODE_AP:
- 		mode = IFM_IEEE80211_HOSTAP;
-@@ -1336,14 +1347,18 @@
+--- 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
+@@ -853,14 +853,18 @@
  		drv = bsd_get_drvindex(global, ifm->ifm_index);
  		if (drv == NULL)
  			return;
@@ -58,3 +22,18 @@
  			wpa_printf(MSG_DEBUG, "RTM_IFINFO: Interface '%s' UP",
  				   drv->ifname);
  			wpa_supplicant_event(drv->ctx, EVENT_INTERFACE_ENABLED,
+@@ -1220,7 +1224,14 @@
+ 		mode = 0 /* STA */;
+ 		break;
+ 	case IEEE80211_MODE_IBSS:
++		/*
++		 * Ref bin/203086 - FreeBSD's net80211 currently uses
++		 * IFM_IEEE80211_ADHOC.
++		 */
++#if 0
+ 		mode = IFM_IEEE80211_IBSS;
++#endif
++		mode = IFM_IEEE80211_ADHOC;
+ 		break;
+ 	case IEEE80211_MODE_AP:
+ 		mode = IFM_IEEE80211_HOSTAP;
diff --git a/net/hostapd/files/patch-src_utils_os__unix.c b/net/hostapd/files/patch-src_utils_os__unix.c
deleted file mode 100644
index c56eee136a44..000000000000
--- a/net/hostapd/files/patch-src_utils_os__unix.c
+++ /dev/null
@@ -1,18 +0,0 @@
---- src/utils/os_unix.c.orig	2015-09-27 19:02:05 UTC
-+++ src/utils/os_unix.c
-@@ -442,6 +442,7 @@ int os_file_exists(const char *fname)
- }
- 
- 
-+#if !defined __FreeBSD__ && !defined __DragonFly__
- int os_fdatasync(FILE *stream)
- {
- 	if (!fflush(stream)) {
-@@ -459,6 +460,7 @@ int os_fdatasync(FILE *stream)
- 
- 	return -1;
- }
-+#endif
- 
- 
- #ifndef WPA_TRACE
diff --git a/net/hostapd/files/patch-src_wps_wps__upnp.c b/net/hostapd/files/patch-src_wps_wps__upnp.c
index 1e3651d33162..ee10b79e48aa 100644
--- a/net/hostapd/files/patch-src_wps_wps__upnp.c
+++ b/net/hostapd/files/patch-src_wps_wps__upnp.c
@@ -1,20 +1,12 @@
---- src/wps/wps_upnp.c.orig	2015-03-15 17:30:39 UTC
-+++ src/wps/wps_upnp.c
-@@ -837,7 +837,7 @@ fail:
- }
- 
- 
--#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
-+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
- #include <sys/sysctl.h>
- #include <net/route.h>
- #include <net/if_dl.h>
-@@ -924,7 +924,7 @@ int get_netif_info(const char *net_if, u
+--- src/wps/wps_upnp.c.orig	2021-03-16 13:50:10.000000000 -0700
++++ src/wps/wps_upnp.c	2021-03-18 12:49:19.537874000 -0700
+@@ -963,7 +963,8 @@
  		goto fail;
  	}
  	os_memcpy(mac, req.ifr_addr.sa_data, 6);
--#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
-+#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
+-#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__APPLE__)
++#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__APPLE__) \
++	|| defined(__DragonFly__)
  	if (eth_get(net_if, mac) < 0) {
  		wpa_printf(MSG_ERROR, "WPS UPnP: Failed to get MAC address");
  		goto fail;