[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-devel] [bug #52748] the bug in timeouts.c

From: Douglas
Subject: [lwip-devel] [bug #52748] the bug in timeouts.c
Date: Sat, 6 Jan 2018 04:40:59 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:57.0) Gecko/20100101 Firefox/57.0

Follow-up Comment #10, bug #52748 (project lwip):


* remove LWIP_TESTMODE code

* TIME_LESS_THAN - do not return true when equal; simplify.

* sys_timeout - move the body to a new function sys_timeout_abs that takes an
absolute time; flatten and simplify.

* sys_check_timeouts: sample sys_now() only at the start of the function;
flatten and simplify.

* lwip_cyclic_timer: use sys_timeout_abs to set the new time. It did not look
correct to simply subtract sys_now and then call sys_timeout, the sys_now in
sys_timeout might be different and they might not cancel out.

> the only bug I see is that if we sleep more than ~25 days (31 bits ms), we
would not know that all timers have surely expired ...

Is that a practical problem for any deployment? Would it be sound to assume
that no timeout were more that 1/4 of that and so scan them to find the
earliest and then rebase them to the current time?

(file #42856)

Additional Item Attachment:

File name: timeouts.c                     Size:12 KB


Reply to this item at:


  Message sent via/by Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]