From 9931a9166b56cc8e0bc3d280704345a5e536821c Mon Sep 17 00:00:00 2001 From: Miroslav Lichvar Date: Tue, 7 Aug 2018 18:01:16 +0200 Subject: [PATCH] cmdmon: include filter length in ADD_SERVER/ADD_PEER request --- candm.h | 3 ++- client.c | 1 + cmdmon.c | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/candm.h b/candm.h index 7886338..cb79739 100644 --- a/candm.h +++ b/candm.h @@ -276,7 +276,8 @@ typedef struct { Float asymmetry; Float offset; uint32_t flags; - uint32_t reserved[4]; + int32_t filter_length; + uint32_t reserved[3]; int32_t EOR; } REQ_NTP_Source; diff --git a/client.c b/client.c index cc00be8..5b6056e 100644 --- a/client.c +++ b/client.c @@ -1122,6 +1122,7 @@ process_cmd_add_server_or_peer(CMD_Request *msg, char *line) (data.params.sel_options & SRC_SELECT_NOSELECT ? REQ_ADDSRC_NOSELECT : 0) | (data.params.sel_options & SRC_SELECT_TRUST ? REQ_ADDSRC_TRUST : 0) | (data.params.sel_options & SRC_SELECT_REQUIRE ? REQ_ADDSRC_REQUIRE : 0)); + msg->data.ntp_source.filter_length = htonl(data.params.filter_length); memset(msg->data.ntp_source.reserved, 0, sizeof (msg->data.ntp_source.reserved)); result = 1; diff --git a/cmdmon.c b/cmdmon.c index 0fedeb8..e069588 100644 --- a/cmdmon.c +++ b/cmdmon.c @@ -800,7 +800,7 @@ handle_add_source(NTP_Source_Type type, CMD_Request *rx_message, CMD_Reply *tx_m params.max_sources = ntohl(rx_message->data.ntp_source.max_sources); params.min_samples = ntohl(rx_message->data.ntp_source.min_samples); params.max_samples = ntohl(rx_message->data.ntp_source.max_samples); - params.filter_length = 0; + params.filter_length = ntohl(rx_message->data.ntp_source.filter_length); params.authkey = ntohl(rx_message->data.ntp_source.authkey); params.max_delay = UTI_FloatNetworkToHost(rx_message->data.ntp_source.max_delay); params.max_delay_ratio =