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

[bug] lease time not working for clients assigned with static ipv4 addresses #132

Closed ghost closed 5 years ago

ghost commented 5 years ago

to some extent this seems to have been mentioned some 3 years ago https://github.com/openwrt/odhcpd/issues/83

dedeckeh commented 5 years ago

The output above does not mean leasetime is not working correctty for static leases. Internally odhcpd set the remaining leasetime to infinite for static leases by design; however it sends in the leasetime option the configured leasetime of 12 hours to the client. This can be verified by checking the DHCP exchange between the client and the server.

ghost commented 5 years ago

Pardon my ignorance, but what means internally? As opposed to what is then externally?

Checked the logs and this exchange is lodged every 6 hours

06-15T18:51:27 odhcpd: received DHCPV4_MSG_REQUEST from 3e:10:d5:86:9f:67 06-15T18:51:27 odhcpd: Sent DHCPV4_MSG_ACK to ff:ff:ff:ff:ff:ff - 255.255.255.255 06-16T00:51:27 odhcpd: received DHCPV4_MSG_REQUEST from 3e:10:d5:86:9f:67 06-16T00:51:27 odhcpd: Sent DHCPV4_MSG_ACK to ff:ff:ff:ff:ff:ff - 255.255.255.255 06-16T06:51:27 odhcpd: received DHCPV4_MSG_REQUEST from 3e:10:d5:86:9f:67 06-16T06:51:27 odhcpd: Sent DHCPV4_MSG_ACK to ff:ff:ff:ff:ff:ff - 255.255.255.255 06-16T12:51:27 odhcpd: received DHCPV4_MSG_REQUEST from 3e:10:d5:86:9f:67 06-16T12:51:27 odhcpd: Sent DHCPV4_MSG_ACK to ff:ff:ff:ff:ff:ff - 255.255.255.255 06-16T18:51:27 odhcpd: received DHCPV4_MSG_REQUEST from 3e:10:d5:86:9f:67 06-16T18:51:27 odhcpd: Sent DHCPV4_MSG_ACK to ff:ff:ff:ff:ff:ff - 255.255.255.255 06-17T00:51:27 odhcpd: received DHCPV4_MSG_REQUEST from 3e:10:d5:86:9f:67 06-17T00:51:27 odhcpd: Sent DHCPV4_MSG_ACK to ff:ff:ff:ff:ff:ff - 255.255.255.255

dedeckeh commented 5 years ago

Don't worry about ignorance; with internally I mean the expiry time of the lease in the internal leasetable. Externally is the leasetime sent in the DHCP leasetime option; for a leasetime of 12 hours the renew time is 6 hours which is in line with the logs above.

ghost commented 5 years ago

Just a bit confusing, as in I felt inclined to open this issue, for the user to be displayed in LuCI the internal value