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

Allen Ye allen.ye at mediatek.com
Thu Feb 26 02:20:13 PST 2026


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 248f808bb..0d5822500 100644
--- a/hostapd/ctrl_iface.c
+++ b/hostapd/ctrl_iface.c
@@ -4593,7 +4593,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
@@ -4772,7 +4772,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;
 
@@ -5700,7 +5700,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 797fd41f8..371f990fe 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.25.1




More information about the Hostap mailing list