From 67ab631168dd786631b9643f1d10757cedb7d0be Mon Sep 17 00:00:00 2001 From: Donat Zenichev Date: Tue, 2 Jun 2026 12:23:29 +0200 Subject: [PATCH] MT#61856 control_ng: preserve support of "CLI" Previous approach based on the strhash used to support an upper case variant of "cli" command. Just preserve it. Current NG_COMMANDS based macro generation, uses only lower cases based on the command name from the table, so not mess things more, just add one exception for the "CLI". Change-Id: I0bb373a50f56a44c13921a24fddf9534379b8e0d --- daemon/control_ng.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/daemon/control_ng.c b/daemon/control_ng.c index cec41ab11..2ff559678 100644 --- a/daemon/control_ng.c +++ b/daemon/control_ng.c @@ -73,6 +73,10 @@ static const struct ng_command_def *ng_command_find(const str *cmd) { #undef XA #undef X + /* Preserve behaviour: both "cli" and "CLI" must be supported */ + if (cmd->len == sizeof("CLI") - 1 && !memcmp(cmd->s, "CLI", sizeof("CLI") - 1)) + return &ng_command_defs[OP_CLI]; + return NULL; }