[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-devel] [bug #29769] sys_check_timeouts: sys_now() may overflow
From: |
Simon Goldschmidt |
Subject: |
[lwip-devel] [bug #29769] sys_check_timeouts: sys_now() may overflow |
Date: |
Tue, 04 May 2010 10:26:24 +0000 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 |
URL:
<http://savannah.nongnu.org/bugs/?29769>
Summary: sys_check_timeouts: sys_now() may overflow
Project: lwIP - A Lightweight TCP/IP stack
Submitted by: goldsimon
Submitted on: Di 04 Mai 2010 10:26:23 GMT
Category: None
Severity: 3 - Normal
Item Group: None
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
Discussion Lock: Any
Planned Release: 1.4.0
lwIP version: CVS Head
_______________________________________________________
Details:
For NO_SYS==1, sys_check_timeouts uses sys_now() time-difference to check for
timeouts. Now when the time wraps around (after 49-something days), no more
timers will get called. Possible solution:
> void
> sys_check_timeouts(void)
> {
> struct sys_timeo *tmptimeout;
> u32_t diff;
> sys_timeout_handler h;
> void *arg;
> int had_one;
> u32_t now;
> #if LWIP_DEBUG_TIMERNAMES
> const char *handler_name;
> #endif /* LWIP_DEBUG_TIMERNAMES */
>
> now = sys_now();
> if (next_timeout) {
> /* @todo: wrap around? */
> // --------- new code
> if (now < timeouts_last_time)
> diff = ( 0xFFFFFFFF - timeouts_last_time ) + now + 1 ;
> else
> // --------- end of new code
> diff = now - timeouts_last_time;
>
_______________________________________________________
Reply to this item at:
<http://savannah.nongnu.org/bugs/?29769>
_______________________________________________
Nachricht geschickt von/durch Savannah
http://savannah.nongnu.org/
- [lwip-devel] [bug #29769] sys_check_timeouts: sys_now() may overflow,
Simon Goldschmidt <=