From aee44d1ef078b8ff06f50d397ce9bc4e27859ec2 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 0dda2588..6a682069 100644 --- a/nest/rt-table.c +++ b/nest/rt-table.c @@ -2021,7 +2021,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++; @@ -2299,7 +2299,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; } @@ -3033,7 +3033,7 @@ rt_prune_table(struct rtable_private *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"); }