Hi Fotis,

On Fri, Feb 17, 2017 at 12:44:35PM +0200, Fotis Panagiotopoulos wrote:
> Hi,
> 
> I have a problem with LWIP, where after some time of normal operation, all
> TCP communications die. After lots of headbanging, I found that tcp_tmr()
> stops beeing called.
> 
> I examined the functions sys_check_timeouts() and sys_timeout(), and found
> out that there is a problem when sys_now wraps around.
> 
> Specifically in the file timeouts.c, lines 214-220 the following snippet
> fails:
> 
>   now = sys_now();
>   if (next_timeout == NULL) {
>     diff = 0;
>     timeouts_last_time = now;
>   } else {
>     diff = now - timeouts_last_time;
>   }
> 
> When sys_now() returns 0 (due to wrap around), the diff variable gets a
> huge number (as it is unsigned), and the tcp timer  (and possibly other
> timers), are scheduled for the very very far future, leading in problematic
> TCP communications.
> 
> Anyone faced this problem? Is this a bug in LWIP, or maybe in my porting
> files? Any hints?

At which value does your sys_now() wrap ?  sys_now() must wrap at 2^32-1.

Sylvain

Attachment: signature.asc
Description: Digital signature

_______________________________________________
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to