diff mbox series

hostapd_cli: Add remove_link command

Message ID 46a3c2d1d9c27795495fbefa4d05fd4afe3ea0a6.1770312673.git.lorenzo@kernel.org
State Accepted
Headers show
Series hostapd_cli: Add remove_link command | expand

Commit Message

Lorenzo Bianconi Feb. 5, 2026, 5:33 p.m. UTC
Introduce remove_link command to hostapd_cli in order to add the
capability to remove link running the following command:

$hostapd_cli -i <intf> remove_link 5

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
 hostapd/hostapd_cli.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

Comments

Jouni Malinen Feb. 9, 2026, 8:18 p.m. UTC | #1
On Thu, Feb 05, 2026 at 06:33:13PM +0100, Lorenzo Bianconi wrote:
> Introduce remove_link command to hostapd_cli in order to add the
> capability to remove link running the following command:
> 
> $hostapd_cli -i <intf> remove_link 5

Thanks, applied.
diff mbox series

Patch

diff --git a/hostapd/hostapd_cli.c b/hostapd/hostapd_cli.c
index b787cc197..73553402b 100644
--- a/hostapd/hostapd_cli.c
+++ b/hostapd/hostapd_cli.c
@@ -1280,6 +1280,20 @@  static int hostapd_cli_cmd_enable_mld(struct wpa_ctrl *ctrl, int argc,
 }
 
 
+#ifdef CONFIG_TESTING_OPTIONS
+static int hostapd_cli_cmd_remove_link(struct wpa_ctrl *ctrl, int argc,
+				       char *argv[])
+{
+	u32 count = argc && atoi(argv[0]) ? atoi(argv[0]) : 1;
+	char buf[64];
+
+	snprintf(buf, sizeof(buf), "LINK_REMOVE %u", count);
+
+	return wpa_ctrl_command(ctrl, buf);
+}
+#endif /* CONFIG_TESTING_OPTIONS */
+
+
 static int hostapd_cli_cmd_disable_mld(struct wpa_ctrl *ctrl, int argc,
 				       char *argv[])
 {
@@ -1802,6 +1816,10 @@  static const struct hostapd_cli_cmd hostapd_cli_commands[] = {
 	  "= disable hostapd on current interface" },
 	{ "enable_mld", hostapd_cli_cmd_enable_mld, NULL,
 	  "= enable AP MLD to which the interface is affiliated" },
+#ifdef CONFIG_TESTING_OPTIONS
+	{ "remove_link", hostapd_cli_cmd_remove_link, NULL,
+	  "<count> = remove MLO link and send MLD reconfiguration IE" },
+#endif /* CONFIG_TESTING_OPTIONS */
 	{ "disable_mld", hostapd_cli_cmd_disable_mld, NULL,
 	  "= disable AP MLD to which the interface is affiliated" },
 	{ "update_beacon", hostapd_cli_cmd_update_beacon, NULL,