From nobody Mon Mar 4 16:44:41 2024 X-Original-To: dev-commits-ports-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TpPgG0T32z5CvVT; Mon, 4 Mar 2024 16:44:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TpPgF6my1z4LBD; Mon, 4 Mar 2024 16:44:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1709570682; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+AlsaEHHguJpmTdfHTbKT8wB8KCevSyejxf62tW77Y8=; b=Cx9cM1RYXn5hahHUUQE07NdSi9bBc6CuagYRT5iE5ezwLAB7mmXG46k82gxamai+yfgOuz rmkhp5NgKcgEAPBxdmUofNxY/MuL3L34loZOSur4E/V0u7BKM2eMOTzcz4s1ijg0ghNXiu JnqhFxXwvzyooqqzBO64do+VlQnTKdNoQF5sZc6Kca/iKLtEKRuY/ozqjLq5TXugKS9ziW RMGshpuKG3mvupFiPvlD4j/1xworW+MaUosXNR74OxEUt+wZOG86Q7sxWwWYTjbqnNdep1 M+E3k+z74wc0qRLqxIejh8INQ7V5OhpyK7mHQzsWBRUZCDnUb9QgvTNP2Jpjog== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1709570682; a=rsa-sha256; cv=none; b=f+GD+dz3BbnN0/rX3Z9IzYKyc0EZFtmaBBKHliWvBD2nf/Mjj9056DQK33kPCNULve2lk8 XkDMoIQD0NZbsPGFViamMBaunaMHDHbVgP3c86y9v0BEvKGQyD0ReK0rUVpnUAx6xgHPEL GdTeOy5TRIP2WZj47YJMEp+kS3bO9ahXmPFR8liiHNvy+3zlZ/MRmZqGpXeru3/FjEoIgV ei2o7u5B52bxN6Ey9OFYkmUB1Ph+l2bJ0tA/iFwOgl/RMKBazjLexCvhgFCu2OrVYiPhWV RTHIB5qlzgJMsWh7EqaLQyf8RjqdcXWrWIDhZaW5zz+3EcWytbrwWSLPe0Uzdw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1709570682; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+AlsaEHHguJpmTdfHTbKT8wB8KCevSyejxf62tW77Y8=; b=GoXe882RJqLPC+QRSHetZt83U/GtmiUccB+AtrvoLts8tDpUvVgJ/VIrqaqBbB2bsoUpWc BI2K3LVwbTocXVTfNyS5pzo4mR4+kybvZImvQS/chxl70zNDAK/KR5/ongfMpZ14FKjaAL mRE0iDFxnmfQPPVXUgpPbzuD0m4O4OZy1Mt4iiMWQQW1jYOtF4DLJzVDDrFozEgXadaJJp PptnJzctJ7AuiSI4cnc/Hj5XSehtNMr2RrbvZPoOgiqKQuGVyJ1idCU0qm+8c0CDVUzdtK YVzPy8oQQiDdiRju0i/ACs5KmouJGaBBypWHEjvmZOKY/qg+P8UC5iKZsDLOVA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TpPgF6NklzV9j; Mon, 4 Mar 2024 16:44:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 424Gifq4094781; Mon, 4 Mar 2024 16:44:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 424Gif3C094778; Mon, 4 Mar 2024 16:44:41 GMT (envelope-from git) Date: Mon, 4 Mar 2024 16:44:41 GMT Message-Id: <202403041644.424Gif3C094778@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Cy Schubert Subject: git: 2dc822b9e7c4 - main - net/hostapd*: Work around lack of MLME support List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2dc822b9e7c44abf61594cbc31379837bb35973d Auto-Submitted: auto-generated The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/ports/commit/?id=2dc822b9e7c44abf61594cbc31379837bb35973d commit 2dc822b9e7c44abf61594cbc31379837bb35973d Author: Cy Schubert AuthorDate: 2024-02-27 04:27:50 +0000 Commit: Cy Schubert CommitDate: 2024-03-04 16:44:36 +0000 net/hostapd*: Work around lack of MLME support hostap MLME uses Linux data structures and definitions not available in FreeBSD. The ability for hostapd to select the frequency (channel) depends Linux MLME, though strictly it's not required. Work around the Linux MLME requirement to configure device frequency. The detailed description is: hostapd will only set the channel (frequency) when Linux MLME is configured. Enabling NEED_AP_MLME will result in numerous build errors due do Linux data structures and definitions not available under FreeBSD. The code to set the frequency from the selected channel is only within the NEED_AP_MLME code path because without MLME, hostapd_get_hw_features() is an inline that always returns -1 whereas with MLME hostapd_get_hw_features() will obtain hardware features from the kernel. Until such time we simply set the frequency as configured. PR: 276375 MFH: 2024Q1 --- net/hostapd-devel/Makefile | 2 +- net/hostapd-devel/files/patch-src_ap_hostapd.c | 31 ++++++++++++++++++++++++++ net/hostapd/Makefile | 2 +- net/hostapd/files/patch-src_ap_hostapd.c | 31 ++++++++++++++++++++++++++ 4 files changed, 64 insertions(+), 2 deletions(-) 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,6 +1,6 @@ PORTNAME= hostapd PORTVERSION= ${COMMIT_DATE} -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= net PKGNAMESUFFIX= -devel 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,6 +1,6 @@ PORTNAME= hostapd PORTVERSION= 2.10 -PORTREVISION= 9 +PORTREVISION= 10 CATEGORIES= net MASTER_SITES= https://w1.fi/releases/ 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: