[openwrt/openwrt] netifd: ensure netifd_loglevel default value as fallback

LEDE Commits lede-commits at lists.infradead.org
Mon Feb 2 00:47:44 PST 2026


robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/b800595a38fc572340bba9bdb851843d38a88aa5

commit b800595a38fc572340bba9bdb851843d38a88aa5
Author: Hannu Nyman <hannu.nyman at iki.fi>
AuthorDate: Sun Feb 1 18:28:57 2026 +0200

    netifd: ensure netifd_loglevel default value as fallback
    
    Commit 168d5af added the possibility to configure netifd logging level.
    The option is read from /etc/config/network and validated.
    Supposedly the validation sets 2 as default.
    
    But in case of a syntax error in /etc/config/network, the validation
    result can be empty. Then the always passed option to netifd is
    just '-l' instead of '-l 2'. That crashes netifd and prevents network
    from launching.
    
    Add a fallback value to the variable, so that there will always be
    a proper value after the '-l' option.
    
    Improves: 168d5af "netifd: add loglevel config option (fixes #18001)"
    Fixes: #21816
    
    Signed-off-by: Hannu Nyman <hannu.nyman at iki.fi>
    Link: https://github.com/openwrt/openwrt/pull/21819
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 package/network/config/netifd/files/etc/init.d/network | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/network/config/netifd/files/etc/init.d/network b/package/network/config/netifd/files/etc/init.d/network
index 6df43be1ac..8a3bf5b9b1 100755
--- a/package/network/config/netifd/files/etc/init.d/network
+++ b/package/network/config/netifd/files/etc/init.d/network
@@ -19,7 +19,7 @@ start_service() {
 
 	procd_open_instance
 	procd_set_param command /sbin/netifd
-	procd_append_param command -l ${netifd_loglevel}
+	procd_append_param command -l ${netifd_loglevel:-2}
 	procd_set_param respawn
 	procd_set_param watch network.interface
 	[ -e /proc/sys/kernel/core_pattern ] && {




More information about the lede-commits mailing list