odhcpd: remove legacy option
authorDavid Härdeman <[email protected]>
Wed, 5 Nov 2025 08:46:31 +0000 (09:46 +0100)
committerÁlvaro Fernández Rojas <[email protected]>
Mon, 10 Nov 2025 11:52:39 +0000 (12:52 +0100)
Support for this option has been removed from odhcpd, so remove it in
the defaults as well.

Signed-off-by: David Härdeman <[email protected]>
Link: https://github.com/openwrt/openwrt/pull/20673
Signed-off-by: Álvaro Fernández Rojas <[email protected]>
package/network/services/odhcpd/Makefile
package/network/services/odhcpd/files/odhcpd.defaults

index c8512bad93e795c1128a94e6cf0e8c4afa7695fe..1828a094b4cd3728be5127915a9e7d60be1adcaf 100644 (file)
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=odhcpd
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(PROJECT_GIT)/project/odhcpd.git
index f64bf9bb0c1743f4a0b2ebe78a92c335b186f99f..ac73780a94f5cc4fc4af398406b3cbc76b7a05e2 100644 (file)
@@ -1,11 +1,20 @@
 #!/bin/sh
 
 if [ -n "$(uci -q get dhcp.odhcpd)" ]; then
+       local commit
+       commit=0
+
        if [ -z "$(uci -q get dhcp.odhcpd.piofolder)" ]; then
                uci set dhcp.odhcpd.piofolder=/tmp/odhcpd-piofolder
-               uci commit dhcp
+               commit=1
+       fi
+
+       if [ -n "$(uci -q get dhcp.odhcpd.legacy)" ]; then
+               uci delete dhcp.odhcpd.legacy
+               commit=1
        fi
 
+       [ "$commit" -eq 1 ] && uci commit dhcp
        exit 0
 fi
 
@@ -34,7 +43,7 @@ case "$protocol" in
        ;;
 esac
 
-uci get dhcp.lan 1>/dev/null 2>/dev/null || {
+uci -q get dhcp.lan || {
 uci batch <<EOF
 set dhcp.lan=dhcp
 set dhcp.lan.interface='lan'