]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
cmdmon: add reserved fields to local command
authorMiroslav Lichvar <mlichvar@redhat.com>
Thu, 4 Apr 2024 13:17:43 +0000 (15:17 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Thu, 4 Apr 2024 14:24:43 +0000 (16:24 +0200)
Add two reserved fields initialized to zero to the new REQ_LOCAL3
command to allow adding more options (e.g. delay in activation) without
changing the command number again.

candm.h
client.c

diff --git a/candm.h b/candm.h
index b4e41f1e89a2917bee943278b20eb7e4daad0dca..401c01568550a143a2e386cdc1e3994d84f60cc3 100644 (file)
--- a/candm.h
+++ b/candm.h
@@ -239,6 +239,7 @@ typedef struct {
   Float distance;
   int32_t orphan;
   Float activate;
+  uint32_t reserved[2];
   int32_t EOR;
 } REQ_Local;
 
index a1e213fe44f46cdbbc0aa5187a775276fb8e46de..d9f60de40bbf00721a8f9f74a222543c490093fb 100644 (file)
--- a/client.c
+++ b/client.c
@@ -772,6 +772,7 @@ process_cmd_local(CMD_Request *msg, char *line)
   msg->data.local.distance = UTI_FloatHostToNetwork(distance);
   msg->data.local.orphan = htonl(orphan);
   msg->data.local.activate = UTI_FloatHostToNetwork(activate);
+  memset(msg->data.local.reserved, 0, sizeof (msg->data.local.reserved));
 
   return 1;
 }