openwrt / odhcpd

This repository is a mirror of https://git.openwrt.org/?p=project/odhcpd.git. Pull requests will be accepted which will be merged in odhcpd.git
GNU General Public License v2.0
160 stars 96 forks source link

odhcp does not handle existing leases from odhcpd.leases file correctly #217

Open schuettecarsten opened 2 months ago

schuettecarsten commented 2 months ago

I've moved the odhcpd.leases file to an attached USB storage. I can see that odhcpd writes leases into this file. When the router reboots, existing IPv6 leases are imported and shown in OpenWrt UI, but when the next device connects to the network and requests an IPv6 address, old leases are dropped completely and only the new lease "survives".

config odhcpd 'odhcpd'
        option maindhcp '0'
        option leasefile '/opt/data/odhcpd.leases'
        option leasetrigger '/usr/sbin/odhcpd-update'
        option loglevel '4'

File content after reboot:

root@GatewayDummi:/opt/data# cat odhcpd.leases
fd2b:43d7:e9a:b2::6f9   laptopc3253.lan laptopc3253
# br-lan 000100012d08fb46e446b02b2317 1a2c6dc1 laptopc3253 1713258035 6f9 128 fd2b:43d7:e9a:b2::6f9/128
# br-lan 0003000668a40e8694e4 12345678 - 1713258215 d08 128 fd2b:43d7:e9a:b2::d08/128

File content after the first IPv6 lease:

root@GatewayDummi:/opt/data# cat odhcpd.leases
fd2b:43d7:e9a:b2::6f9   laptopc3253.lan laptopc3253
# br-lan 000100012d08fb46e446b02b2317 1a2c6dc1 laptopc3253 1713259959 6f9 128 fd2b:43d7:e9a:b2::6f9/128