diff --git a/clientlog.c b/clientlog.c index 72682e1..dbb76b9 100644 --- a/clientlog.c +++ b/clientlog.c @@ -127,6 +127,7 @@ static int active; /* Global statistics */ static uint32_t total_hits[MAX_SERVICES]; static uint32_t total_drops[MAX_SERVICES]; +static uint32_t total_ntp_auth_hits; static uint32_t total_record_drops; #define NSEC_PER_SEC 1000000000U @@ -585,6 +586,14 @@ CLG_LimitServiceRate(CLG_Service service, int index) /* ================================================== */ +void +CLG_LogAuthNtpRequest(void) +{ + total_ntp_auth_hits++; +} + +/* ================================================== */ + void CLG_GetNtpTimestamps(int index, NTP_int64 **rx_ts, NTP_int64 **tx_ts) { Record *record; diff --git a/clientlog.h b/clientlog.h index de3eb98..6349646 100644 --- a/clientlog.h +++ b/clientlog.h @@ -42,6 +42,7 @@ extern void CLG_Finalise(void); extern int CLG_GetClientIndex(IPAddr *client); extern int CLG_LogServiceAccess(CLG_Service service, IPAddr *client, struct timespec *now); extern int CLG_LimitServiceRate(CLG_Service service, int index); +extern void CLG_LogAuthNtpRequest(void); extern void CLG_GetNtpTimestamps(int index, NTP_int64 **rx_ts, NTP_int64 **tx_ts); extern int CLG_GetNtpMinPoll(void); diff --git a/ntp_core.c b/ntp_core.c index 8a99ceb..4da9e95 100644 --- a/ntp_core.c +++ b/ntp_core.c @@ -2096,6 +2096,8 @@ NCR_ProcessRxUnknown(NTP_Remote_Address *remote_addr, NTP_Local_Address *local_a /* Don't respond unless a non-zero KoD was returned */ if (kod == 0) return; + } else if (info.auth.mode != NTP_AUTH_NONE && info.auth.mode != NTP_AUTH_MSSNTP) { + CLG_LogAuthNtpRequest(); } /* If it is an NTPv4 packet with a long MAC and no extension fields,