parent
93615b19a6
commit
e2ea79ac21
@ -1,2 +1,2 @@
|
||||
0f5de043b395311a58bcf4be9800f7118afd5f59 SOURCES/chrony-4.2.tar.gz
|
||||
2e1fac8161ea8d92d76532c0b272fb31799bc310 SOURCES/clknetsim-824c48.tar.gz
|
||||
4661e5df181a9761b73caeaef2f2ab755bbe086a SOURCES/chrony-4.5.tar.gz
|
||||
e021461c23fe4e5c46fd53c449587d8f6cc217ae SOURCES/clknetsim-5d1dc0.tar.gz
|
||||
|
@ -1,2 +1,2 @@
|
||||
SOURCES/chrony-4.2.tar.gz
|
||||
SOURCES/clknetsim-824c48.tar.gz
|
||||
SOURCES/chrony-4.5.tar.gz
|
||||
SOURCES/clknetsim-5d1dc0.tar.gz
|
||||
|
@ -1,108 +0,0 @@
|
||||
commit 33a1fe7a9ce223d6287ab7b11bca3208e9255cdd
|
||||
Author: Miroslav Lichvar <mlichvar@redhat.com>
|
||||
Date: Wed Mar 9 15:30:16 2022 +0100
|
||||
|
||||
ntp: split out conf_id allocation
|
||||
|
||||
diff --git a/ntp_sources.c b/ntp_sources.c
|
||||
index 3cbb2ae7..30770825 100644
|
||||
--- a/ntp_sources.c
|
||||
+++ b/ntp_sources.c
|
||||
@@ -698,21 +698,25 @@ static int get_unused_pool_id(void)
|
||||
|
||||
/* ================================================== */
|
||||
|
||||
-NSR_Status
|
||||
-NSR_AddSource(NTP_Remote_Address *remote_addr, NTP_Source_Type type,
|
||||
- SourceParameters *params, uint32_t *conf_id)
|
||||
+static uint32_t
|
||||
+get_next_conf_id(uint32_t *conf_id)
|
||||
{
|
||||
- NSR_Status s;
|
||||
-
|
||||
- s = add_source(remote_addr, NULL, type, params, INVALID_POOL, last_conf_id + 1);
|
||||
- if (s != NSR_Success)
|
||||
- return s;
|
||||
-
|
||||
last_conf_id++;
|
||||
+
|
||||
if (conf_id)
|
||||
*conf_id = last_conf_id;
|
||||
|
||||
- return s;
|
||||
+ return last_conf_id;
|
||||
+}
|
||||
+
|
||||
+/* ================================================== */
|
||||
+
|
||||
+NSR_Status
|
||||
+NSR_AddSource(NTP_Remote_Address *remote_addr, NTP_Source_Type type,
|
||||
+ SourceParameters *params, uint32_t *conf_id)
|
||||
+{
|
||||
+ return add_source(remote_addr, NULL, type, params, INVALID_POOL,
|
||||
+ get_next_conf_id(conf_id));
|
||||
}
|
||||
|
||||
/* ================================================== */
|
||||
@@ -725,6 +729,7 @@ NSR_AddSourceByName(char *name, int port, int pool, NTP_Source_Type type,
|
||||
struct SourcePool *sp;
|
||||
NTP_Remote_Address remote_addr;
|
||||
int i, new_sources, pool_id;
|
||||
+ uint32_t cid;
|
||||
|
||||
/* If the name is an IP address, add the source with the address directly */
|
||||
if (UTI_StringToIP(name, &remote_addr.ip_addr)) {
|
||||
@@ -770,14 +775,12 @@ NSR_AddSourceByName(char *name, int port, int pool, NTP_Source_Type type,
|
||||
|
||||
append_unresolved_source(us);
|
||||
|
||||
- last_conf_id++;
|
||||
- if (conf_id)
|
||||
- *conf_id = last_conf_id;
|
||||
+ cid = get_next_conf_id(conf_id);
|
||||
|
||||
for (i = 0; i < new_sources; i++) {
|
||||
if (i > 0)
|
||||
remote_addr.ip_addr.addr.id = ++last_address_id;
|
||||
- if (add_source(&remote_addr, name, type, params, us->pool_id, last_conf_id) != NSR_Success)
|
||||
+ if (add_source(&remote_addr, name, type, params, us->pool_id, cid) != NSR_Success)
|
||||
return NSR_TooManySources;
|
||||
}
|
||||
|
||||
|
||||
commit 1219f99935ca9597eb0e4f4c6039e536462cf1a6
|
||||
Author: Miroslav Lichvar <mlichvar@redhat.com>
|
||||
Date: Wed Mar 9 15:34:16 2022 +0100
|
||||
|
||||
ntp: keep original source IP address
|
||||
|
||||
When an added source is specified by IP address, save the original
|
||||
string instead of formatting a new string from the parsed address, which
|
||||
can be different (e.g. compressed vs expanded IPv6 address).
|
||||
|
||||
This fixes the chronyc sourcename command and -N option to print the IP
|
||||
address exactly as it was specified in the configuration file or chronyc
|
||||
add command.
|
||||
|
||||
diff --git a/ntp_sources.c b/ntp_sources.c
|
||||
index 30770825..d46c211d 100644
|
||||
--- a/ntp_sources.c
|
||||
+++ b/ntp_sources.c
|
||||
@@ -353,7 +353,6 @@ add_source(NTP_Remote_Address *remote_addr, char *name, NTP_Source_Type type,
|
||||
record_lock = 1;
|
||||
|
||||
record = get_record(slot);
|
||||
- assert(!name || !UTI_IsStringIP(name));
|
||||
record->name = Strdup(name ? name : UTI_IPToString(&remote_addr->ip_addr));
|
||||
record->data = NCR_CreateInstance(remote_addr, type, params, record->name);
|
||||
record->remote_addr = NCR_GetRemoteAddress(record->data);
|
||||
@@ -734,7 +733,8 @@ NSR_AddSourceByName(char *name, int port, int pool, NTP_Source_Type type,
|
||||
/* If the name is an IP address, add the source with the address directly */
|
||||
if (UTI_StringToIP(name, &remote_addr.ip_addr)) {
|
||||
remote_addr.port = port;
|
||||
- return NSR_AddSource(&remote_addr, type, params, conf_id);
|
||||
+ return add_source(&remote_addr, name, type, params, INVALID_POOL,
|
||||
+ get_next_conf_id(conf_id));
|
||||
}
|
||||
|
||||
/* Make sure the name is at least printable and has no spaces */
|
@ -0,0 +1,39 @@
|
||||
commit e11b518a1ffa704986fb1f1835c425844ba248ef
|
||||
Author: Miroslav Lichvar <mlichvar@redhat.com>
|
||||
Date: Mon Jan 8 11:35:56 2024 +0100
|
||||
|
||||
ntp: fix authenticated requests in serverstats
|
||||
|
||||
Fix the CLG_UpdateNtpStats() call to count requests passing the
|
||||
authentication check instead of requests triggering a KoD response
|
||||
(i.e. NTS NAK).
|
||||
|
||||
diff --git a/ntp_core.c b/ntp_core.c
|
||||
index 023e60b2..35801744 100644
|
||||
--- a/ntp_core.c
|
||||
+++ b/ntp_core.c
|
||||
@@ -2736,7 +2736,7 @@ NCR_ProcessRxUnknown(NTP_Remote_Address *remote_addr, NTP_Local_Address *local_a
|
||||
CLG_DisableNtpTimestamps(&ntp_rx);
|
||||
}
|
||||
|
||||
- CLG_UpdateNtpStats(kod != 0 && info.auth.mode != NTP_AUTH_NONE &&
|
||||
+ CLG_UpdateNtpStats(kod == 0 && info.auth.mode != NTP_AUTH_NONE &&
|
||||
info.auth.mode != NTP_AUTH_MSSNTP,
|
||||
rx_ts->source, interleaved ? tx_ts->source : NTP_TS_DAEMON);
|
||||
|
||||
diff --git a/test/system/010-nts b/test/system/010-nts
|
||||
index 8d92bbc8..b215efa3 100755
|
||||
--- a/test/system/010-nts
|
||||
+++ b/test/system/010-nts
|
||||
@@ -45,6 +45,11 @@ check_chronyc_output "^Name/IP address Mode KeyID Type KLen Last Atm
|
||||
=========================================================================
|
||||
127\.0\.0\.1 NTS 1 (30|15) (128|256) [0-9] 0 0 [78] ( 64|100)$" || test_fail
|
||||
|
||||
+run_chronyc "serverstats" || test_fail
|
||||
+check_chronyc_output "NTS-KE connections accepted: 1
|
||||
+NTS-KE connections dropped : 0
|
||||
+Authenticated NTP packets : [1-9][0-9]*" || test_fail
|
||||
+
|
||||
stop_chronyd || test_fail
|
||||
check_chronyd_messages || test_fail
|
||||
check_chronyd_files || test_fail
|
Loading…
Reference in new issue