[PATCH v9 3/7] hostapd: Expand hostapd_cli and ctrl_iface buffer size

Allen Ye allen.ye at mediatek.com
Mon Dec 1 03:10:38 PST 2025


Increase the buffer size from 4096 to 8192 bytes to accommodate
potentially large AFC JSON responses.

Signed-off-by: Allen Ye <allen.ye at mediatek.com>
---
 hostapd/ctrl_iface.c  | 6 +++---
 hostapd/hostapd_cli.c | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
index d7e5c6071..7457df5a3 100644
--- a/hostapd/ctrl_iface.c
+++ b/hostapd/ctrl_iface.c
@@ -4507,7 +4507,7 @@ static void hostapd_ctrl_iface_receive(int sock, void *eloop_ctx,
 	struct sockaddr_storage from;
 	socklen_t fromlen = sizeof(from);
 	char *reply, *pos = buf;
-	const int reply_size = 4096;
+	const int reply_size = 8192;
 	int reply_len;
 	int level = MSG_DEBUG;
 #ifdef CONFIG_CTRL_IFACE_UDP
@@ -4686,7 +4686,7 @@ static void hostapd_mld_ctrl_iface_receive(int sock, void *eloop_ctx,
 	struct sockaddr_storage from;
 	socklen_t fromlen = sizeof(from);
 	char *reply, *pos = buf;
-	const size_t reply_size = 4096;
+	const size_t reply_size = 8192;
 	int reply_len;
 	int level = MSG_DEBUG;
 
@@ -5598,7 +5598,7 @@ static void hostapd_global_ctrl_iface_receive(int sock, void *eloop_ctx,
 	socklen_t fromlen = sizeof(from);
 	char *reply;
 	int reply_len;
-	const int reply_size = 4096;
+	const int reply_size = 8192;
 #ifdef CONFIG_CTRL_IFACE_UDP
 	unsigned char lcookie[CTRL_IFACE_COOKIE_LEN];
 #endif /* CONFIG_CTRL_IFACE_UDP */
diff --git a/hostapd/hostapd_cli.c b/hostapd/hostapd_cli.c
index b787cc197..711a90c51 100644
--- a/hostapd/hostapd_cli.c
+++ b/hostapd/hostapd_cli.c
@@ -200,7 +200,7 @@ static void hostapd_cli_msg_cb(char *msg, size_t len)
 
 static int _wpa_ctrl_command(struct wpa_ctrl *ctrl, const char *cmd, int print)
 {
-	char buf[4096];
+	char buf[8192];
 	size_t len;
 	int ret;
 
-- 
2.45.2




More information about the Hostap mailing list