]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
cmdmon: add reserved fields to ntpdata reply
authorMiroslav Lichvar <mlichvar@redhat.com>
Mon, 12 Dec 2016 11:50:48 +0000 (12:50 +0100)
committerMiroslav Lichvar <mlichvar@redhat.com>
Tue, 13 Dec 2016 11:57:25 +0000 (12:57 +0100)
This might be useful if ntpdata is changed to not require authorization
and new fields need to be added without breaking compatibility.

candm.h
cmdmon.c

diff --git a/candm.h b/candm.h
index 75425b92c30d903b0d92dd854ec4036f9b4d5966..ff17f428946023ddd1659f28a9a9c055b7a55087 100644 (file)
--- a/candm.h
+++ b/candm.h
@@ -672,6 +672,7 @@ typedef struct {
   uint32_t total_tx_count;
   uint32_t total_rx_count;
   uint32_t total_valid_count;
+  uint32_t reserved[4];
   int32_t EOR;
 } RPY_NTPData;
 
index cbfcdea45c94977db689c5460ce91a9c09c32802..00e9f4e240e37103c3e12b22832a81cd53a5d544 100644 (file)
--- a/cmdmon.c
+++ b/cmdmon.c
@@ -1232,6 +1232,7 @@ handle_ntp_data(CMD_Request *rx_message, CMD_Reply *tx_message)
   tx_message->data.ntp_data.total_tx_count = htonl(report.total_tx_count);
   tx_message->data.ntp_data.total_rx_count = htonl(report.total_rx_count);
   tx_message->data.ntp_data.total_valid_count = htonl(report.total_valid_count);
+  memset(tx_message->data.ntp_data.reserved, 0xff, sizeof (tx_message->data.ntp_data.reserved));
 }
 
 /* ================================================== */