lwip icon indicating copy to clipboard operation
lwip copied to clipboard

Bug in unix/sys_arch.c

Open peskybp opened this issue 11 years ago • 3 comments

The sys_now() function improperly uses a u32_t type for the usec variable. This causes large time differences of 4x10^6 to occur when the tv.tv_usec value is less than the starttime.tv_usec value.

If the type of just the usec variable and the cast are changed to s32_t, everything is fine.

peskybp avatar Mar 05 '13 03:03 peskybp

Can you clarify which file you are referring to? There is no unix/sys_arch.c, and nxpcommon/arch/sys_arch.c doesn't have a usec variable.

goertzenator avatar Mar 05 '13 14:03 goertzenator

Sorry about that, here's the full path:

contrib-1.4.0/ports/unix/sys_arch.c

peskybp avatar Mar 05 '13 15:03 peskybp

Oooo, nice catch! Unfortunately I just made this github snapshot for my own easy reference and don't intend to maintain it. I'm sure the upstream project would like to know about this. I don't know offhand exactly where to report it, but http://savannah.nongnu.org/projects/lwip would be a good place to start looking.

goertzenator avatar Mar 05 '13 16:03 goertzenator