Re: Dhcpcd not renewing lease in time
Roy Marples
Thu Oct 17 13:37:04 2019
Hi Jonas
On 17/10/2019 13:22, Jonas Ramstrand wrote:
Hi Roy/list
I’m troubleshooting an issue where we’ve seen devices using dhcp is
using the same ip address.
What I’ve observed is that I don’t see dhcpcd renewing the ip address in
time, for example (one hour lease time):
Oct 15 18:32:09.706 ASC01832500056 dhcpcd[786]: wlan0: leased
172.20.16.155 for 3600 seconds
Oct 15 18:32:09.706 ASC01832500056 dhcpcd[786]: wlan0: renew in 1800
seconds, rebind in 3150 seconds
…
Oct 15 21:23:53.808 ASC01832500056 dhcpcd[786]: wlan0: renewing
lease of 172.20.16.155
Oct 15 21:23:53.809 ASC01832500056 dhcpcd[786]: wlan0: sending
REQUEST (xid 0x1319a0ae), next in 3.9 seconds
Oct 15 21:23:53.861 ASC01832500056 dhcpcd[786]: wlan0: acknowledged
172.20.16.155 from 1.1.1.1
Oct 15 21:23:53.862 ASC01832500056 dhcpcd[786]: wlan0: leased
172.20.16.155 for 3600 seconds
Oct 15 21:23:53.863 ASC01832500056 dhcpcd[786]: wlan0: renew in 1800
seconds, rebind in 3150 seconds
So int this case, the device uses the ip address for almost 2 hours
after it expired.
The device is battery powered, so suspend is used. What I’ve understood,
is that dhcpcd is using monotonic clock and that it’s not ticking during
suspend.
Is there any solutions for this in dhcpcd? It creates quite tricky bugs.
The currect solution is for the kernel to notify interfaces that link is
down upon resuming and then notify the correct link state afterwards.
dhcpcd will spot this and start renewal of the lease right away.
Using the system time rather than the monotonic clock is not feasable as
system time can move which also breaks renewals.
Roy
Archive administrator: postmaster@marples.name