[Olsr-users] 0.5.6 Routes disappear after 4 mins of uptime, then all OK - suspect clock sync

Henning Rogge (spam-protected)
Thu Sep 4 08:10:06 CEST 2008


Am Mittwoch 03 September 2008 18:28:32 schrieb Hannes Gredler:
> On Wed, Sep 03, 2008 at 06:18:54PM +0200, Henning Rogge wrote:
> | we could just use a function like this to compare two time-values:
> |
> | int olsr_timer_cmp(olsr_u32_t t1, olsr_u32_t t2) {
> |    if (t1 == t2)
> |       return 0;
> |
> |    if (t1 > t2 && (t1-t2) < (1<<31)) {
> |        return 1;
> |    return -1;
> | }
>
> you are assuming that you have no timer in the system
> that ever spans across a 2^31 clocktick period and that
> 2^31 clocktick is sufficiently large (order of days).
I think 2^31 milliseconds (I would like to normalize our clock to something 
like this) should be more than enough. That's 596 day or nearly two years.

> i just wonder on a sufficient small clocktick resolution
> one could break this form of overflow detection.
With normalization that should be no problem.

Henning


*************************************************
Diplom Informatiker Henning Rogge
Forschungsgesellschaft für
Angewandte Naturwissenschaften e. V. (FGAN) 
Neuenahrer Str. 20, 53343 Wachtberg, Germany
Tel.: 0049 (0)228 9435-961
Fax: 0049 (0)228 9435-685
E-Mail: (spam-protected)
Web: www.fgan.de
************************************************
Sitz der Gesellschaft: Bonn
Registergericht: Amtsgericht Bonn VR 2530
Vorstand: Dr. rer. nat. Ralf Dornhaus (Vors.), Prof. Dr. Joachim Ender 
(Stellv.)




More information about the Olsr-users mailing list