net: dhcp: fix bounds check in timeout
The flag value UINT32_MAX is returned from manage_timers() when a send operation did not succeed. This indicates that the timeout should not be rescheduled, but because it will never replace the starting update value UINT32_MAX-1 the check will never pass, and in cases where it should work will be submitted to run at UINT32_MAX-1 seconds. Fix the upper bound. Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
This commit is contained in:
parent
d44b4252b7
commit
5da984e890
@ -602,7 +602,7 @@ static uint32_t dhcph4_manage_timers(struct net_if *iface, int64_t timeout)
|
||||
|
||||
static void dhcpv4_timeout(struct k_work *work)
|
||||
{
|
||||
uint32_t timeout_update = UINT32_MAX - 1;
|
||||
uint32_t timeout_update = UINT32_MAX;
|
||||
int64_t timeout = k_uptime_get();
|
||||
struct net_if_dhcpv4 *current, *next;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user