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 <j@w1.fi>
This commit is contained in:
Jouni Malinen 2013-11-02 11:52:35 +02:00
parent b253e6ff55
commit 3f134b4357

View file

@ -1,6 +1,6 @@
/* /*
* hostapd / UNIX domain socket -based control interface * hostapd / UNIX domain socket -based control interface
* Copyright (c) 2004-2012, Jouni Malinen <j@w1.fi> * Copyright (c) 2004-2013, Jouni Malinen <j@w1.fi>
* *
* This software may be distributed under the terms of the BSD license. * This software may be distributed under the terms of the BSD license.
* See README for more details. * See README for more details.
@ -1494,6 +1494,7 @@ static void hostapd_global_ctrl_iface_receive(int sock, void *eloop_ctx,
return; return;
} }
buf[res] = '\0'; buf[res] = '\0';
wpa_printf(MSG_DEBUG, "Global ctrl_iface command: %s", buf);
os_memcpy(reply, "OK\n", 3); os_memcpy(reply, "OK\n", 3);
reply_len = 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) { if (os_strcmp(buf, "PING") == 0) {
os_memcpy(reply, "PONG\n", 5); os_memcpy(reply, "PONG\n", 5);
reply_len = 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) { } else if (os_strncmp(buf, "ADD ", 4) == 0) {
if (hostapd_ctrl_iface_add(interfaces, buf + 4) < 0) if (hostapd_ctrl_iface_add(interfaces, buf + 4) < 0)
reply_len = -1; reply_len = -1;