config: properly set log level from uci
authorÁlvaro Fernández Rojas <[email protected]>
Wed, 22 Oct 2025 14:32:23 +0000 (16:32 +0200)
committerÁlvaro Fernández Rojas <[email protected]>
Wed, 22 Oct 2025 16:02:23 +0000 (18:02 +0200)
The condition to set the log level from the uci config if it hadn't been
set from the command line should be inverted to work properly.

Signed-off-by: Álvaro Fernández Rojas <[email protected]>
src/config.c

index 6a33b7ce937e37c9edcd184027da2cb5f748e3b8..3e916ad4cdac1a43bea6d92fcdf7d4de7e17d002 100644 (file)
@@ -453,7 +453,7 @@ static void set_config(struct uci_section *s)
        if ((c = tb[ODHCPD_ATTR_LOGLEVEL])) {
                int log_level = (blobmsg_get_u32(c) & LOG_PRIMASK);
 
-               if (config.log_level != log_level && config.log_level_cmdline) {
+               if (config.log_level != log_level && !config.log_level_cmdline) {
                        config.log_level = log_level;
                        if (config.log_syslog)
                                setlogmask(LOG_UPTO(config.log_level));