]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
unix-socket: Avoid spurious logs on close
authorMichael Smith <msmith@mindbridge.ai>
Tue, 22 Jun 2021 02:33:47 +0000 (22:33 -0400)
committerVictor Julien <victor@inliniac.net>
Mon, 23 Aug 2021 18:27:53 +0000 (20:27 +0200)
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

index 4661bb14f9c505d6de6b05983e6585662729e627..9213039db93c2c4664da4b7517ba2fe0cbaaac37 100644 (file)
@@ -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);