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

Hannes Gredler (spam-protected)
Wed Sep 3 18:28:32 CEST 2008


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 just wonder on a sufficient small clocktick resolution
one could break this form of overflow detection.

/hannes




More information about the Olsr-users mailing list