From c8342aecbfa6d61a12cd2d686be5765d49d7d178 Mon Sep 17 00:00:00 2001 From: Maria Matejka Date: Tue, 9 Apr 2024 19:14:30 +0200 Subject: [PATCH] Fixed in-table route refresh counter to not randomly add 256 --- nest/rt-table.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nest/rt-table.c b/nest/rt-table.c index c1a1a17b..f0f8a7f3 100644 --- a/nest/rt-table.c +++ b/nest/rt-table.c @@ -1949,7 +1949,7 @@ rt_stop_import(struct rt_import_request *req, void (*stopped)(struct rt_import_r /* Cancel table rr_counter */ if (hook->stale_set != hook->stale_pruned) - tab->rr_counter -= (hook->stale_set - hook->stale_pruned); + tab->rr_counter -= ((int) hook->stale_set - (int) hook->stale_pruned); tab->rr_counter++; @@ -2182,7 +2182,7 @@ rt_refresh_begin(struct rt_import_request *req) e->stale_cycle = 0; /* Smash the route refresh counter and zero everything. */ - tab->rr_counter -= hook->stale_set - hook->stale_pruned; + tab->rr_counter -= ((int) hook->stale_set - (int) hook->stale_pruned); hook->stale_set = hook->stale_valid = hook->stale_pruning = hook->stale_pruned = 0; } @@ -2862,7 +2862,7 @@ rt_prune_table(void *_tab) } else if (ih->stale_pruning != ih->stale_pruned) { - tab->rr_counter -= (ih->stale_pruning - ih->stale_pruned); + tab->rr_counter -= ((int) ih->stale_pruning - (int) ih->stale_pruned); ih->stale_pruned = ih->stale_pruning; rt_refresh_trace(tab, ih, "table prune after refresh end"); }