From: Miroslav Lichvar Date: Mon, 10 Feb 2025 14:08:03 +0000 (+0100) Subject: cmdmon: drop handling of NULL and LOGON requests X-Git-Tag: 4.7-pre1~47 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9ba6e7655c87a60afeca11ea4ac53eadf7b48e48;p=thirdparty%2Fchrony.git cmdmon: drop handling of NULL and LOGON requests Handle the NULL and LOGON requests as unknown (invalid) instead of returning the success and failed status respectively. They have been unused for very long time now. --- diff --git a/candm.h b/candm.h index 401c0156..277fa9a5 100644 --- a/candm.h +++ b/candm.h @@ -37,7 +37,6 @@ #define DEFAULT_CANDM_PORT 323 /* Request codes */ -#define REQ_NULL 0 #define REQ_ONLINE 1 #define REQ_OFFLINE 2 #define REQ_BURST 3 @@ -223,11 +222,6 @@ typedef struct { int32_t EOR; } REQ_Modify_Makestep; -typedef struct { - Timespec ts; - int32_t EOR; -} REQ_Logon; - typedef struct { Timespec ts; int32_t EOR; @@ -487,7 +481,6 @@ typedef struct { REQ_Modify_Polltarget modify_polltarget; REQ_Modify_Maxupdateskew modify_maxupdateskew; REQ_Modify_Makestep modify_makestep; - REQ_Logon logon; REQ_Settime settime; REQ_Local local; REQ_Manual manual; diff --git a/cmdmon.c b/cmdmon.c index 4accdf6f..841f3bd9 100644 --- a/cmdmon.c +++ b/cmdmon.c @@ -1595,10 +1595,6 @@ read_from_cmd_socket(int sock_fd, int event, void *anything) LOG_SetContext(LOGC_Command); switch(rx_command) { - case REQ_NULL: - /* Do nothing */ - break; - case REQ_DUMP: handle_dump(&rx_message, &tx_message); break; @@ -1643,11 +1639,6 @@ read_from_cmd_socket(int sock_fd, int event, void *anything) handle_modify_makestep(&rx_message, &tx_message); break; - case REQ_LOGON: - /* Authentication is no longer supported, log-on always fails */ - tx_message.status = htons(STT_FAILED); - break; - case REQ_SETTIME: handle_settime(&rx_message, &tx_message); break; diff --git a/pktlength.c b/pktlength.c index 8d5ffa7a..d9348efa 100644 --- a/pktlength.c +++ b/pktlength.c @@ -55,7 +55,7 @@ struct request_length { }; static const struct request_length request_lengths[] = { - REQ_LENGTH_ENTRY(null, null), /* NULL */ + { 0, 0 }, /* NULL - not supported */ REQ_LENGTH_ENTRY(online, null), /* ONLINE */ REQ_LENGTH_ENTRY(offline, null), /* OFFLINE */ REQ_LENGTH_ENTRY(burst, null), /* BURST */ @@ -65,7 +65,7 @@ static const struct request_length request_lengths[] = { REQ_LENGTH_ENTRY(modify_maxdelay, null), /* MODIFY_MAXDELAY */ REQ_LENGTH_ENTRY(modify_maxdelayratio, null), /* MODIFY_MAXDELAYRATIO */ REQ_LENGTH_ENTRY(modify_maxupdateskew, null), /* MODIFY_MAXUPDATESKEW */ - REQ_LENGTH_ENTRY(logon, null), /* LOGON */ + { 0, 0 }, /* LOGON - not supported */ REQ_LENGTH_ENTRY(settime, manual_timestamp), /* SETTIME */ { 0, 0 }, /* LOCAL */ REQ_LENGTH_ENTRY(manual, null), /* MANUAL */