mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-04 12:55:06 -05:00
clientlog: refactor client record and API
Refactor the client record and clientlog API to reuse more code between different services and enumerate the services instead of hardcoding NTP and cmdmon.
This commit is contained in:
4
cmdmon.c
4
cmdmon.c
@@ -1350,11 +1350,11 @@ read_from_cmd_socket(int sock_fd, int event, void *anything)
|
||||
return;
|
||||
}
|
||||
|
||||
log_index = CLG_LogCommandAccess(&remote_ip, &cooked_now);
|
||||
log_index = CLG_LogServiceAccess(CLG_CMDMON, &remote_ip, &cooked_now);
|
||||
|
||||
/* Don't reply to all requests from hosts other than localhost if the rate
|
||||
is excessive */
|
||||
if (!localhost && log_index >= 0 && CLG_LimitCommandResponseRate(log_index)) {
|
||||
if (!localhost && log_index >= 0 && CLG_LimitServiceRate(CLG_CMDMON, log_index)) {
|
||||
DEBUG_LOG("Command packet discarded to limit response rate");
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user