From patchwork Fri Sep 11 12:59:50 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Berg X-Patchwork-Id: 2303248 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=n0oguxXm; 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=tyrtAcIh; 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 4hhVbJ6hhRz1xwp for ; Sat, 12 Sep 2026 09:08:44 +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=n0oguxXm8dNDpP obYMxEXqJwGkA2SWIxkxnr4Q+QL3jh+UsvV9WuMvXv3SV+PKGwqexLx9Gvc4eXvYNdY85Oi+BZN+j Io8Iho2i4+R+ElAGgJhPqomlqhqNj1Jz35YQNh2Hu4XE9bRnewj0Z2ciabXhjqoLnL/+eqwAaVCYm HHVUf485USSpv2s1p8/cFK/GgBgCJ1QA5MTiHvsBaCqYKV+yuLrr7E23p5fEPwfpzTrKWUBRRLXkZ ZqC3brkNcxOnWiskJ7OQ8wAr/ifLVDGQ9JwYDNj73YhUKyPQ0FaQDo3Z7K59kOa3PuYom0baayiV4 hko5v3Kxcn1i3JxPTFZA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1x5AIe-00000000KUZ-20tJ; Fri, 11 Sep 2026 23:04:52 +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 1x5AIa-00000000KRr-2XKp for hostap@lists.infradead.org; Fri, 11 Sep 2026 23:04:50 +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=1789167888; x=1790377488; b=tyrtAcIhIghZo+7pmrKkE8CYQSVQ4VOgt91ULW19lcH2jkx 7gB7/PbtnxHQvk/fLtFT3MSbYmRQ2I2ehYlHMf01W7FBg5ONFkvIhrxMgPcgFYo3zsAw7pKoDZluS JGyyY245p9cRBvA36RG038qgrGYaKY4KQTEruZ0G5uZ5fxyacZqMQSPA6DAqrjDU5RcVBDxXkLOxu aG38UPdCDJCpFxI0drIW9eWndw2LRejoMy7oWnxMnaxDZ42/2z5rV8S56NiGXTU+Ojap2hqcWJ6hF Zghogi8mbxtVYNmBAMvRLGYK8Y9LkjsEt01JLX4cToHmunEmmF0dGHZlLYzCPNjQ==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__ECDSA_SECP256R1_SHA256__AES_256_GCM:256) (Exim 4.98.2) (envelope-from ) id 1x5AIX-0000000CP3F-1a7Q; Sat, 12 Sep 2026 01:04:45 +0200 From: Johannes Berg To: hostap@lists.infradead.org Cc: Johannes Berg Subject: [PATCH v2 2/6] hostapd: ctrl_iface: add LINK_STA command Date: Sat, 12 Sep 2026 00:59:50 +0200 Message-ID: <20260912010440.f55a67f2cced.Ic8a6681ef4102a46e0d61cfb0ebdcdb311985d8e@changeid> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260911230440.2087889-8-johannes@sipsolutions.net> References: <20260911230440.2087889-8-johannes@sipsolutions.net> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260911_160448_643082_15B9DE58 X-CRM114-Status: GOOD ( 12.14 ) 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_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -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,