From patchwork Mon Sep 14 02:42:06 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Berg X-Patchwork-Id: 2304108 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=ENhn4ptL; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=sipsolutions.net header.i=@sipsolutions.net header.a=rsa-sha256 header.s=mail header.b=a7/5UXEg; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4hk4b35rKKz1xws for ; Mon, 14 Sep 2026 22:43:59 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=fAupM7lRPzcijXEyxQZDhiIFACZFkC+kKyLZmUiYmno=; b=ENhn4ptLqNoN8R A+NGEhmRAzTFT31ysqOE9V7oD2y9hQRCJid2YdJa+HMHY4ECNqjot4gvPe2xHw5+4oAVYwR07Z5Yc Y33d0I0XWGZyOPRcIYigaNs+lZiCefI1zQZhVlSHsOhnECj1FuVgK2+Mclw5HA/FVHoRdvjuaLXuz WKMDquk8J8lNZ7xUgak8wnPgxBpXsGaK4h1o5CMG5tWS3ZjqGxyFaWAbE6NI+1PzKmUGORgkoDq00 fio+kZhNWPF78LJ1RAwu/LRmqfo5wdEs9aeSGqNUcyI/M2SfoJzkXYrlCxdA/PLd/vzvudaKztrmS arSQlun0ZJc2U2YvXdag==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1x660o-00000003bJp-3Fqo; Mon, 14 Sep 2026 12:42:18 +0000 Received: from s3.sipsolutions.net ([2a01:4f8:242:246e::2] helo=sipsolutions.net) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1x660m-00000003bFW-1MDT for hostap@lists.infradead.org; Mon, 14 Sep 2026 12:42:17 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Content-Type:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-To: Resent-Cc:Resent-Message-ID; bh=RwcbaOFz5tHHjNt7Pydiqu3BTgwLuF2/9i9j+47wqQE=; t=1789389736; x=1790599336; b=a7/5UXEgyeQQurmCJKad31Vk9yof5kgSrsTXkAWqpoaYc4m B1ZeIK197QLEPG1kB579uZLVi/nLxSNKMqC4Ir1hRUdCiQc0DF+5PNVOTHtKYxCkAGX8jw2mIPf/2 2QuKDO3AhLkRMyxifXL7LpeZy0OdsX76z9dP/WATUmevYx+APFh+E8XPhtZ3bxRO14NMfeabI30Xl SuEsLtLw1yQNAFz2TwY9o5K+j686QNFiuqr13d3Q/04vujgA0gGT3Opo15/9jlt4pd7GutIyjr7ap /MYA8+bhcu0D9LtjU1EYI9JyYcxF4NKptfw+0Fn2islQXl0teWj6jnM9gZyiIVNw==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__ECDSA_SECP256R1_SHA256__AES_256_GCM:256) (Exim 4.98.2) (envelope-from ) id 1x660g-0000000FSHD-0vDb; Mon, 14 Sep 2026 14:42:10 +0200 From: Johannes Berg To: hostap@lists.infradead.org Cc: Johannes Berg Subject: [PATCH v3 2/6] hostapd: ctrl_iface: add LINK_STA command Date: Mon, 14 Sep 2026 14:42:06 +0200 Message-ID: <20260914144205.cffcd5bdae80.Ic8a6681ef4102a46e0d61cfb0ebdcdb311985d8e@changeid> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260914144205.4bbd4597b9f5.I91a1d4893862b7f2e04707626ba62c2216e835c9@changeid> References: <20260914144205.4bbd4597b9f5.I91a1d4893862b7f2e04707626ba62c2216e835c9@changeid> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260914_054216_361669_A8766E9A X-CRM114-Status: GOOD ( 12.40 ) X-Spam-Score: -2.1 (--) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: Johannes Berg This can be used to look up a station by link address. Signed-off-by: Johannes Berg --- hostapd/ctrl_iface.c | 5 +++++ src/ap/ctrl_iface_ap.c | 19 +++++++++++++++++++ src/ap/ctrl_iface_ap.h | 4 ++++ 3 files changed, 28 insertions [...] Content analysis details: (-2.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.0 DMARC_MISSING Missing DMARC policy X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Johannes Berg This can be used to look up a station by link address. Signed-off-by: Johannes Berg --- hostapd/ctrl_iface.c | 5 +++++ src/ap/ctrl_iface_ap.c | 19 +++++++++++++++++++ src/ap/ctrl_iface_ap.h | 4 ++++ 3 files changed, 28 insertions(+) diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c index c37e9cec5989..047aa3d154ef 100644 --- a/hostapd/ctrl_iface.c +++ b/hostapd/ctrl_iface.c @@ -4326,6 +4326,11 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd, } else if (os_strncmp(buf, "STA ", 4) == 0) { reply_len = hostapd_ctrl_iface_sta(hapd, buf + 4, reply, reply_size); +#ifdef CONFIG_IEEE80211BE + } else if (os_strncmp(buf, "LINK_STA ", 9) == 0) { + reply_len = hostapd_ctrl_iface_link_sta(hapd, buf + 9, reply, + reply_size); +#endif /* CONFIG_IEEE80211BE */ } else if (os_strncmp(buf, "STA-NEXT ", 9) == 0) { reply_len = hostapd_ctrl_iface_sta_next(hapd, buf + 9, reply, reply_size); diff --git a/src/ap/ctrl_iface_ap.c b/src/ap/ctrl_iface_ap.c index 57ec4f6ec12d..223f9601623a 100644 --- a/src/ap/ctrl_iface_ap.c +++ b/src/ap/ctrl_iface_ap.c @@ -587,6 +587,25 @@ int hostapd_ctrl_iface_sta_next(struct hostapd_data *hapd, const char *txtaddr, } +#ifdef CONFIG_IEEE80211BE +int hostapd_ctrl_iface_link_sta(struct hostapd_data *hapd, + const char *txtaddr, char *buf, size_t buflen) +{ + u8 addr[ETH_ALEN]; + struct sta_info *sta; + + if (hwaddr_aton(txtaddr, addr)) + return -1; + + sta = ap_get_link_sta(hapd, addr); + if (!sta) + return -1; + + return hostapd_ctrl_iface_sta_mib(hapd, sta, buf, buflen); +} +#endif /* CONFIG_IEEE80211BE */ + + #ifdef CONFIG_P2P_MANAGER static int p2p_manager_disconnect(struct hostapd_data *hapd, u16 stype, u8 minor_reason_code, const u8 *addr) diff --git a/src/ap/ctrl_iface_ap.h b/src/ap/ctrl_iface_ap.h index 4de140844f0b..e2add32570c6 100644 --- a/src/ap/ctrl_iface_ap.h +++ b/src/ap/ctrl_iface_ap.h @@ -15,6 +15,10 @@ int hostapd_ctrl_iface_sta(struct hostapd_data *hapd, const char *txtaddr, char *buf, size_t buflen); int hostapd_ctrl_iface_sta_next(struct hostapd_data *hapd, const char *txtaddr, char *buf, size_t buflen); +#ifdef CONFIG_IEEE80211BE +int hostapd_ctrl_iface_link_sta(struct hostapd_data *hapd, + const char *txtaddr, char *buf, size_t buflen); +#endif /* CONFIG_IEEE80211BE */ int hostapd_ctrl_iface_deauthenticate(struct hostapd_data *hapd, const char *txtaddr); int hostapd_ctrl_iface_disassociate(struct hostapd_data *hapd,