mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-04 04:35:06 -05:00
ntp: enable NTS support
Add an option to enable NTS for an NTP source. Check for NTS-specific extension fields and pass the packets to the NTS-NTP code in order to enable the NTS client and server.
This commit is contained in:
12
ntp_core.c
12
ntp_core.c
@@ -559,7 +559,17 @@ NCR_CreateInstance(NTP_Remote_Address *remote_addr, NTP_Source_Type type,
|
||||
result->auto_offline = params->auto_offline;
|
||||
result->poll_target = params->poll_target;
|
||||
|
||||
if (params->authkey != INACTIVE_AUTHKEY) {
|
||||
if (params->nts) {
|
||||
IPSockAddr nts_address;
|
||||
|
||||
if (result->mode == MODE_ACTIVE)
|
||||
LOG(LOGS_WARN, "NTS not supported with peers");
|
||||
|
||||
nts_address.ip_addr = remote_addr->ip_addr;
|
||||
nts_address.port = params->nts_port;
|
||||
|
||||
result->auth = NAU_CreateNtsInstance(&nts_address, name, &result->remote_addr);
|
||||
} else if (params->authkey != INACTIVE_AUTHKEY) {
|
||||
result->auth = NAU_CreateSymmetricInstance(params->authkey);
|
||||
} else {
|
||||
result->auth = NAU_CreateNoneInstance();
|
||||
|
||||
Reference in New Issue
Block a user