0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-09-16 18:35:19 +00:00

Lib: Expand timer recurrence to 64b

The period of recurent timers was stored in 32b field, despite it was
btime-compatible value in us. Therefore, it was limited to ~72 min,
which mas okay for most purposes, except configurable MRT dump periods.

Thanks to Felix Friedlander for the bugreport.
This commit is contained in:
Ondrej Zajicek 2024-08-27 14:28:41 +02:00
parent 5214d7e59f
commit acbdc29d57
2 changed files with 4 additions and 4 deletions

View File

@ -110,9 +110,9 @@ tm_dump(resource *r)
if (t->randomize)
debug("rand %d, ", t->randomize);
if (t->recurrent)
debug("recur %d, ", t->recurrent);
debug("recur %ld, ", t->recurrent);
if (t->expires)
debug("expires in %d ms)\n", (t->expires - current_time()) TO_MS);
debug("expires in %ld ms)\n", (t->expires - current_time()) TO_MS);
else
debug("inactive)\n");
}

View File

@ -22,8 +22,8 @@ typedef struct timer
void *data;
btime expires; /* 0=inactive */
btime recurrent; /* Timer recurrence */
uint randomize; /* Amount of randomization */
uint recurrent; /* Timer recurrence */
int index;
} timer;
@ -72,7 +72,7 @@ tm_remains(timer *t)
}
static inline timer *
tm_new_init(pool *p, void (*hook)(struct timer *), void *data, uint rec, uint rand)
tm_new_init(pool *p, void (*hook)(struct timer *), void *data, btime rec, uint rand)
{
timer *t = tm_new(p);
t->hook = hook;