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

79252ed0c0...ca00527e5f

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
This commit is contained in:
Álvaro Fernández Rojas
2025-12-06 17:01:00 +01:00
parent 46532c9bcb
commit 4e4986aaf6
2 changed files with 59 additions and 8 deletions

View File

@@ -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@gmail.com>
PKG_LICENSE:=GPL-2.0

View File

@@ -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