]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Fixed in-table route refresh counter to not randomly add 256
authorMaria Matejka <mq@ucw.cz>
Tue, 9 Apr 2024 17:14:30 +0000 (19:14 +0200)
committerMaria Matejka <mq@ucw.cz>
Sat, 18 May 2024 13:47:45 +0000 (15:47 +0200)
nest/rt-table.c

index 0dda2588a34a78c4d7b4ab630c4b47b9b86d06c1..6a6820692e4a066581b14bb30e64120db579e53b 100644 (file)
@@ -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");
     }