diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-12 05:01:23 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-12 05:01:23 +0000 |
commit | a05990c6c7250ba0aaed94e0222b598e0190bad4 (patch) | |
tree | c3661f2aea2badd5ef62949469ccb98935c8e20b /ntp_signd.c | |
parent | Adding debian version 4.5-3. (diff) | |
download | chrony-a05990c6c7250ba0aaed94e0222b598e0190bad4.tar.xz chrony-a05990c6c7250ba0aaed94e0222b598e0190bad4.zip |
Merging upstream version 4.6.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | ntp_signd.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/ntp_signd.c b/ntp_signd.c index 77b3249..e52c8f5 100644 --- a/ntp_signd.c +++ b/ntp_signd.c @@ -99,6 +99,9 @@ static int sock_fd; /* Flag indicating if the MS-SNTP authentication is enabled */ static int enabled; +/* Flag limiting logging of connection error messages */ +static int logged_connection_error; + /* ================================================== */ static void read_write_socket(int sock_fd, int event, void *anything); @@ -134,6 +137,14 @@ open_socket(void) sock_fd = SCK_OpenUnixStreamSocket(path, NULL, 0); if (sock_fd < 0) { sock_fd = INVALID_SOCK_FD; + + /* Log an error only once before a successful exchange to avoid + flooding the system log */ + if (!logged_connection_error) { + LOG(LOGS_ERR, "Could not connect to signd socket %s : %s", path, strerror(errno)); + logged_connection_error = 1; + } + return 0; } @@ -160,6 +171,8 @@ process_response(SignInstance *inst) return; } + logged_connection_error = 0; + /* Check if the file descriptor is still valid */ if (!NIO_IsServerSocket(inst->local_addr.sock_fd)) { DEBUG_LOG("Invalid NTP socket"); |