client: ignore case in add command

For consistency with chronyd configuration, make the source type in the
add command case insensitive.
This commit is contained in:
Miroslav Lichvar 2020-08-17 17:18:04 +02:00
parent 1885729024
commit 598cd10c34

View file

@ -1057,11 +1057,11 @@ process_cmd_add_source(CMD_Request *msg, char *line)
word = line; word = line;
line = CPS_SplitWord(line); line = CPS_SplitWord(line);
if (!strcmp(word, "server")) { if (!strcasecmp(word, "server")) {
type = REQ_ADDSRC_SERVER; type = REQ_ADDSRC_SERVER;
} else if (!strcmp(word, "peer")) { } else if (!strcasecmp(word, "peer")) {
type = REQ_ADDSRC_PEER; type = REQ_ADDSRC_PEER;
} else if (!strcmp(word, "pool")) { } else if (!strcasecmp(word, "pool")) {
type = REQ_ADDSRC_POOL; type = REQ_ADDSRC_POOL;
} else { } else {
LOG(LOGS_ERR, "Invalid syntax for add command"); LOG(LOGS_ERR, "Invalid syntax for add command");