mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2025-01-20 16:01:53 +00:00
Use correct comparison on max generation
This commit is contained in:
parent
1c12cc9a11
commit
f28713a0dd
@ -39,7 +39,7 @@ stats_rt_notify(struct proto *P UNUSED, struct channel *src_ch, const net_addr *
|
|||||||
if (old)
|
if (old)
|
||||||
{
|
{
|
||||||
ch->counters[old->generation]--;
|
ch->counters[old->generation]--;
|
||||||
if (old->generation < ch->max_generation)
|
if (old->generation <= ch->max_generation)
|
||||||
{
|
{
|
||||||
changed = 1;
|
changed = 1;
|
||||||
ch->counters[COUNTER]--;
|
ch->counters[COUNTER]--;
|
||||||
@ -49,7 +49,7 @@ stats_rt_notify(struct proto *P UNUSED, struct channel *src_ch, const net_addr *
|
|||||||
if (new)
|
if (new)
|
||||||
{
|
{
|
||||||
ch->counters[new->generation]++;
|
ch->counters[new->generation]++;
|
||||||
if (new->generation < ch->max_generation)
|
if (new->generation <= ch->max_generation)
|
||||||
{
|
{
|
||||||
changed = 1;
|
changed = 1;
|
||||||
ch->counters[COUNTER]++;
|
ch->counters[COUNTER]++;
|
||||||
@ -136,7 +136,7 @@ stats_reconfigure(struct proto *P, struct proto_config *CF)
|
|||||||
|
|
||||||
/* recalculate sum */
|
/* recalculate sum */
|
||||||
sc->counters[COUNTER] = 0;
|
sc->counters[COUNTER] = 0;
|
||||||
for (u8 i = 0; i < sc->max_generation; i++)
|
for (u8 i = 0; i <= sc->max_generation; i++)
|
||||||
sc->counters[COUNTER] += sc->counters[i];
|
sc->counters[COUNTER] += sc->counters[i];
|
||||||
|
|
||||||
sc->sum = sc->counters[COUNTER];
|
sc->sum = sc->counters[COUNTER];
|
||||||
|
Loading…
Reference in New Issue
Block a user