Skip to content

Commit 5da984e

Browse files
pabigotjukkar
authored andcommitted
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 <[email protected]>
1 parent d44b425 commit 5da984e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

subsys/net/ip/dhcpv4.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,7 @@ static uint32_t dhcph4_manage_timers(struct net_if *iface, int64_t timeout)
602602

603603
static void dhcpv4_timeout(struct k_work *work)
604604
{
605-
uint32_t timeout_update = UINT32_MAX - 1;
605+
uint32_t timeout_update = UINT32_MAX;
606606
int64_t timeout = k_uptime_get();
607607
struct net_if_dhcpv4 *current, *next;
608608

0 commit comments

Comments
 (0)