include $(TOPDIR)/rules.mk
PKG_NAME:=odhcpd
-PKG_RELEASE:=5
+PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=$(PROJECT_GIT)/project/odhcpd.git
-PKG_MIRROR_HASH:=7e7b331972ca1e9847c49dd65e37fbb16c9c3b04dec479a1fa6f2b216a5f53f1
-PKG_SOURCE_DATE:=2025-11-04
-PKG_SOURCE_VERSION:=d44af6dd8f4e1dd0d858ae19419057ab4f319310
+PKG_MIRROR_HASH:=2b5f21240010d1374f92800c1aa586edf646566fc1b853f35cda93032779aca4
+PKG_SOURCE_DATE:=2025-11-14
+PKG_SOURCE_VERSION:=d3dc577d7e843b21ecae0b17de4a6cce36b075db
PKG_LICENSE:=GPL-2.0
if [ -n "$(uci -q get dhcp.odhcpd)" ]; then
local commit
+ local hostsfile
+
commit=0
if [ -z "$(uci -q get dhcp.odhcpd.piofolder)" ]; then
commit=1
fi
+ hostsfile=$(uci -q get dhcp.odhcpd.hostsfile)
+ if [ -n "$hostsfile" ]; then
+ uci delete dhcp.odhcpd.hostsfile
+ uci set dhcp.odhcpd.hostsdir="$(dirname $hostsfile)"
+ commit=1
+ elif [ -z "$(uci -q get dhcp.odhcpd.hostsdir)" ]; then
+ uci set dhcp.odhcpd.hostsdir=/tmp/hosts
+ commit=1
+ fi
+
+ if [ "$(uci -q get dhcp.odhcpd.leasefile)" == "/tmp/hosts/odhcpd" ]; then
+ uci set dhcp.odhcpd.leasefile=/tmp/odhcpd.leases
+ commit=1
+ fi
+
[ "$commit" -eq 1 ] && uci commit dhcp
+
exit 0
fi
uci batch <<EOF
set dhcp.odhcpd=odhcpd
set dhcp.odhcpd.maindhcp=$ODHCPDONLY
-set dhcp.odhcpd.leasefile=/tmp/hosts/odhcpd
+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.hostsdir=/tmp/hosts
set dhcp.lan.dhcpv4=$V4MODE
set dhcp.lan.dhcpv6=$V6MODE
set dhcp.lan.ra=$V6MODE