0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-12-23 02:01:55 +00:00

Fix bug in stats_rt_notify()

This commit is contained in:
Vojtech Vilimek 2022-07-15 13:59:14 +02:00
parent 3f9b92d273
commit 248236db6d

View File

@ -36,24 +36,17 @@ stats_rt_notify(struct proto *P, struct channel *src_ch, const net_addr *n, rte
struct stats_config *cf = (void *) P->cf; struct stats_config *cf = (void *) P->cf;
log(L_INFO "stats_rf_notify()"); log(L_INFO "stats_rf_notify()");
if (new && old) if (old)
{ {
new->generation = old->generation + 1;
p->counters[old->generation]--; p->counters[old->generation]--;
log(L_INFO "counter %u decreased", old->generation);
}
if (new)
{
p->counters[new->generation]++; p->counters[new->generation]++;
log(L_INFO "counter %u increased", new->generation); log(L_INFO "counter %u increased", new->generation);
} }
else if (new && !old)
{
new->generation = 0;
p->counters[0]++;
log(L_INFO "counter 0 increased");
}
else if (!new && old)
{
(p->counters[old->generation])--;
log(L_INFO "counter %u decreased", old->generation);
}
} }
static int static int