[Olsr-dev] olsr strange behaving / nearly no outgoing packets [partly solved]

Ferry Huberts (spam-protected)
Thu Aug 9 08:24:49 CEST 2012

On 09-08-12 02:20, Lars Kruse wrote:
> Hi,
> (sent to olsr-users before by mistake - sorry!)
> returning to an older discussion about lost packets ...
> (with a bit of progress)
>> it's already "solved" in a way where we can say: it doesn't have to do
>> anything with settings or setup, it's more a thing with our friend ... the
>> compiler or uclibc. i tried with eglibc today, but i need more time to
>> investigate.
> Here I have an Asus WL500G (brcm47xx). It shows the same problems that you
> described.
> After some hours of testing I found two workarounds:
> (1) disable space optimization (Advanced configuration options -> Target
> options -> Target optimizations; remove "-Os")
> OR
> (2) apply the attached patch
> If you take a closer look at the patch you will notice, that it does not really
> do anything useful. To be honest: as soon as you remove the fprintf line the
> bug will appear again. I tested this back and forth for several times but the
> behaviour stays the same.
> The unpatched "olsr_times" function (with default space optimization enabled)
> returns values between -1000 and +1000 on brcm47xx (depending on the initial
> usec value in "first_tv"). On other platforms it returns the number of
> milliseconds passed since startup. The problematic behaviour seems to be
> caused by
>     (tv.tv_sec - first_tv.tv_sec) * 1000
> This part of the "return" value (last line of "olsr_times") seems to result in
> zero for all input values - but only in combination with the rest of the line.
> Calculating this value separately returns the expected result.
> I guess the next step would be an analysis of the compiler's machine code for
> this specific line, or?
> Now I don't know how to continue with debugging. Please tell me if you need
> more information.
> cheers,
> Lars

does this line fix it?
>   return (tv.tv_sec - first_tv.tv_sec) * (__time_t)1000 + (tv.tv_usec - first_tv.tv_usec) / (__suseconds_t)1000;


Ferry Huberts

More information about the Olsr-dev mailing list