[openwrt/openwrt] odhcpd: update to Git HEAD (2025-12-10)

LEDE Commits lede-commits at lists.infradead.org
Wed Dec 10 00:54:44 PST 2025


noltari pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/4e4986aaf6e7f77da0f01fce54b067de3538e438

commit 4e4986aaf6e7f77da0f01fce54b067de3538e438
Author: Álvaro Fernández Rojas <noltari at gmail.com>
AuthorDate: Sat Dec 6 17:01:00 2025 +0100

    odhcpd: update to Git HEAD (2025-12-10)
    
    ca00527e5fc3 statefiles: don't write empty hosts files
    24b70c5c2ff0 Revert "statefiles: fix escape sequence for broken hostname output"
    5203ad13954c statefiles: fix stale pio handling for !ubus
    a64760b30f67 odhcpd: rename piofolder to piodir
    6779344a8c8a statefiles: use tmpfile functions for pio files
    9f8abcc662d0 statefiles: rename prefix information functions
    cb65b83e524e config: move pio json handling to statefiles.c
    5b01849cc42c statefiles: add a dirfd helper function
    eadde3d7dd74 statefiles: add tmp helper functions
    c29aa7091498 statefiles: fix escape sequence for broken hostname output
    00f2d7a4dbe5 dhcpv4: don't send zero IPv6-only preferred option
    c86d29bb83d6 Revert "dhcpv6-ia: add some noise to the T1 and T2 periods"
    b062769ab85f Revert "do not delegate ULA prefixes"
    fd4714bb2dfe do not delegate ULA prefixes
    81ea5bfef775 dhcpv6-ia: add some noise to the T1 and T2 periods
    
    https://github.com/openwrt/odhcpd/compare/79252ed0c0c2...ca00527e5fc3
    
    Signed-off-by: Álvaro Fernández Rojas <noltari at gmail.com>
---
 package/network/services/odhcpd/Makefile           |  6 +--
 .../network/services/odhcpd/files/odhcpd.defaults  | 61 ++++++++++++++++++++--
 2 files changed, 59 insertions(+), 8 deletions(-)

diff --git a/package/network/services/odhcpd/Makefile b/package/network/services/odhcpd/Makefile
index 9d125734a7..92dfd823b4 100644
--- a/package/network/services/odhcpd/Makefile
+++ b/package/network/services/odhcpd/Makefile
@@ -12,9 +12,9 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(PROJECT_GIT)/project/odhcpd.git
-PKG_MIRROR_HASH:=7d2a69c9f514c01c4e520034554fe7da9a9fe065b9bccb9f0c7063f657c5b9fb
-PKG_SOURCE_DATE:=2025-12-04
-PKG_SOURCE_VERSION:=79252ed0c0c26659a95729da0f2accaa0ddb458d
+PKG_MIRROR_HASH:=cce1d4f3c88f4eec0cf8b19429f12e6fc2f47dca9b4d643a31569c1209f8fabc
+PKG_SOURCE_DATE:=2025-12-10
+PKG_SOURCE_VERSION:=ca00527e5fc3d8d2b8c1a60fbeb6a25e2bf68674
 
 PKG_MAINTAINER:=Álvaro Fernández Rojas <noltari at gmail.com>
 PKG_LICENSE:=GPL-2.0
diff --git a/package/network/services/odhcpd/files/odhcpd.defaults b/package/network/services/odhcpd/files/odhcpd.defaults
index 76c75b060a..fbb7ec92af 100644
--- a/package/network/services/odhcpd/files/odhcpd.defaults
+++ b/package/network/services/odhcpd/files/odhcpd.defaults
@@ -1,13 +1,64 @@
 #!/bin/sh
 
+. /usr/share/libubox/jshn.sh
+
+pio_file_check() {
+	local file valid
+
+	file=$1
+	valid=0
+
+	json_init
+	json_load_file $file 2> /dev/null
+
+	if json_is_a slaac array; then
+		local keys len
+
+		json_select slaac
+		json_get_keys keys
+
+		len=$(echo $keys | wc -w)
+		if [ $len -gt 0 ]; then
+			valid=1
+		fi
+	fi
+
+	echo $valid
+}
+
+pio_folder_migrate() {
+	local piodir piofolder
+
+	piofolder=$1
+	piodir=$2
+
+	[ -d $piofolder ] || return
+	[ -d $piodir ] || mkdir -p $piodir
+
+	for file in $piofolder/*; do
+		[ -e "$file" ] || continue
+		if [ $(pio_file_check $file) -eq 1 ]; then
+			mv $file $piodir/odhcpd.pio.$(basename $file)
+		fi
+	done
+}
+
 if [ -n "$(uci -q get dhcp.odhcpd)" ]; then
-	local commit
-	local hostsfile
+	local commit hostsfile piodir piofolder
 
 	commit=0
 
-	if [ -z "$(uci -q get dhcp.odhcpd.piofolder)" ]; then
-		uci set dhcp.odhcpd.piofolder=/tmp/odhcpd-piofolder
+	piodir=$(uci -q get dhcp.odhcpd.piodir)
+	if [ -z "$piodir" ]; then
+		piodir=/tmp/odhcpd-piodir
+		uci set dhcp.odhcpd.piodir=$piodir
+		commit=1
+	fi
+
+	piofolder=$(uci -q get dhcp.odhcpd.piofolder)
+	if [ -n "$piofolder" ]; then
+		pio_folder_migrate $piofolder $piodir
+		uci delete dhcp.odhcpd.piofolder
 		commit=1
 	fi
 
@@ -78,7 +129,7 @@ set dhcp.odhcpd.maindhcp=$ODHCPDONLY
 set dhcp.odhcpd.leasefile=/tmp/odhcpd.leases
 set dhcp.odhcpd.leasetrigger=/usr/sbin/odhcpd-update
 set dhcp.odhcpd.loglevel=4
-set dhcp.odhcpd.piofolder=/tmp/odhcpd-piofolder
+set dhcp.odhcpd.piodir=/tmp/odhcpd-piodir
 set dhcp.odhcpd.hostsdir=/tmp/hosts
 set dhcp.lan.dhcpv4=$V4MODE
 set dhcp.lan.dhcpv6=$V6MODE




More information about the lede-commits mailing list