From 3f134b4357a02edf025224c8efcf8ab0e6fe006d Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sat, 2 Nov 2013 11:52:35 +0200 Subject: [PATCH] hostapd: Accept RELOG from global control interface This makes it easier to recycle log file (-f) when no active interface is in use. Signed-hostap: Jouni Malinen --- hostapd/ctrl_iface.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c index 0d8999255..e6758d955 100644 --- a/hostapd/ctrl_iface.c +++ b/hostapd/ctrl_iface.c @@ -1,6 +1,6 @@ /* * hostapd / UNIX domain socket -based control interface - * Copyright (c) 2004-2012, Jouni Malinen + * Copyright (c) 2004-2013, Jouni Malinen * * This software may be distributed under the terms of the BSD license. * See README for more details. @@ -1494,6 +1494,7 @@ static void hostapd_global_ctrl_iface_receive(int sock, void *eloop_ctx, return; } buf[res] = '\0'; + wpa_printf(MSG_DEBUG, "Global ctrl_iface command: %s", buf); os_memcpy(reply, "OK\n", 3); reply_len = 3; @@ -1501,6 +1502,9 @@ static void hostapd_global_ctrl_iface_receive(int sock, void *eloop_ctx, if (os_strcmp(buf, "PING") == 0) { os_memcpy(reply, "PONG\n", 5); reply_len = 5; + } else if (os_strncmp(buf, "RELOG", 5) == 0) { + if (wpa_debug_reopen_file() < 0) + reply_len = -1; } else if (os_strncmp(buf, "ADD ", 4) == 0) { if (hostapd_ctrl_iface_add(interfaces, buf + 4) < 0) reply_len = -1;