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 */
...
}
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