mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-03 16:35:06 -05:00
ntp: add server support for KoD RATE
Add "kod" option to the ratelimit directive to respond with the KoD RATE code to randomly selected requests exceeding the configured limit. This complements the client support of KoD RATE. It's disabled by default. There can be only one KoD code in one response. If both NTS NAK and RATE codes are triggered, drop the response. The KoD RATE code can be set in an NTS-authenticated response.
This commit is contained in:
@@ -2717,6 +2717,13 @@ NCR_ProcessRxUnknown(NTP_Remote_Address *remote_addr, NTP_Local_Address *local_a
|
||||
return;
|
||||
}
|
||||
|
||||
if (limit == CLG_KOD) {
|
||||
/* Don't respond if there is a conflict with the NTS NAK */
|
||||
if (kod != 0)
|
||||
return;
|
||||
kod = KOD_RATE;
|
||||
}
|
||||
|
||||
local_ntp_rx = NULL;
|
||||
tx_ts = NULL;
|
||||
interleaved = 0;
|
||||
|
||||
Reference in New Issue
Block a user