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:
parent
3f9b92d273
commit
248236db6d
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user