]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Kick settle timer when receiving updates in rt_notify()
authorIgor Putovny <igor.putovny@nic.cz>
Thu, 13 Jun 2024 14:36:12 +0000 (16:36 +0200)
committerIgor Putovny <igor.putovny@nic.cz>
Thu, 13 Jun 2024 14:36:12 +0000 (16:36 +0200)
proto/aggregator/aggregator.c
proto/aggregator/aggregator.h

index da6cf4a14b649e641acdd070cab26956fd3c839d..b57260a91c1f91c53a9b1b1109d6046e23be0be3 100644 (file)
@@ -1317,10 +1317,22 @@ aggregator_rt_notify(struct proto *P, struct channel *src_ch, net *net, rte *new
   if (p->p.proto_state != PS_UP)
     return;
 
-  if (!p->root)
-    trie_init(p);
+  if (PREFIX_AGGR == p->aggr_mode)
+  {
+    assert(p->root == NULL);
 
-  channel_request_feeding(p->src);
+    /*
+     * Don't kick settle timer during first run. That would cause
+     * repeated calls to rt_notify() without any new updates.
+     */
+    if (!p->first_run)
+    {
+      log("rt notify: kick");
+      settle_kick(&p->notify_settle);
+    }
+
+    return;
+  }
 
   /* Find the objects for the old route */
   if (old)
@@ -1501,9 +1513,6 @@ aggregator_rt_notify(struct proto *P, struct channel *src_ch, net *net, rte *new
     ASSERT_DIE(!old_bucket->rte && !old_bucket->count);
     HASH_REMOVE2(p->buckets, AGGR_BUCK, p->p.pool, old_bucket);
   }
-
-  assert(p->root != NULL);
-  settle_kick(&p->notify_settle);
 }
 
 static int
index cac0813f6c29cb712cbde7b8da7757a5383683e4..61f6ff3d57aaba86f95d5952946ee849a91e2066 100644 (file)
@@ -81,7 +81,6 @@ struct aggregator_proto {
   struct settle notify_settle;
   int before_count;
   int after_count;
-  int aggr_done;
 };
 
 enum aggr_item_type {