From a64783b3e2f7f1a58050ca5f8d7f85c2a16a9c0a Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Mon, 21 Jun 2021 22:33:47 -0400 Subject: [PATCH] unix-socket: Avoid spurious logs on close Avoid spurious logs when suricatasc closes connection. Use SCLogDebug for control connection EOF, and SCLogError for an error. As Chandan Chowdhury described in redmine 3685. This makes the logging consistent with the older `if (client->version <= UNIX_PROTO_V1)` block about 20 lines above, and avoids polluting the logs with `Unix socket: lost connection with client`. --- src/unix-manager.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/unix-manager.c b/src/unix-manager.c index 4661bb14f9..9213039db9 100644 --- a/src/unix-manager.c +++ b/src/unix-manager.c @@ -572,9 +572,9 @@ static void UnixCommandRun(UnixCommand * this, UnixClient *client) do { if (ret <= 0) { if (ret == 0) { - SCLogInfo("Unix socket: lost connection with client"); + SCLogDebug("Unix socket: lost connection with client"); } else { - SCLogInfo("Unix socket: error on recv() from client: %s", + SCLogError(SC_ERR_SOCKET, "Unix socket: error on recv() from client: %s", strerror(errno)); } UnixCommandClose(this, client->fd);