We have a customer that has captured Wireshark data showing that the DHCP lease is expiring. Investigation has determined the cause is in .\Freescale_MQX_4_2\rtcs\source\tcpip\dhcpclnt.c\DHCPCLNT_service_ack(). Normally the lease is renewed at 1/2 the lease interval. When the device receives the ack to the renewal request it gets a lease period which is shorter than the current lease period. Because of this, the DHCP client decides to let the lease to expire.
When the new lease is less than the old lease why does the DHCP client decide it should not renew the lease?
Is this a bug? If so, how should I fix it?
//example
dhcp_ptr->NEW_DATA.LEASE = 10800; //ie 3 hours
dhcp_ptr->DATA.LEASE = 14400; //ie. 4 hours
DHCPCLNT_service_ack()
{
...
if (dhcp_ptr->NEW_DATA.LEASE < dhcp_ptr->DATA.LEASE) {
/* Our request was refused, wait for termination to bind again */
renew_again = FALSE;
}/* Endif */
...
}
Are you saying that since the lease period has changed, that means the DHCP server does not want to renew the current lease? I thought the DHCP server is allowed to change the lease period as a part of the lease renewal?
Regards,
Kevin
Hi kfranz
I would suggest you check the following link, a similar issue about DHCP client. Maybe you can try the customer's solution to see whether it helps
TCPIP Event timing error in MQX 4.2
Regards
Daniel
Hi Kfranz:
It seems the DHCP server does not wish to renew the current lease, then only the terminate event will be set for the remainder of the lease. wait for termination to bind again.
Regards
Daniel