]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
tmp: enhancements in trie api changes
authorVojtech Vilimek <vojtech.vilimek@nic.cz>
Fri, 14 Apr 2023 09:30:55 +0000 (11:30 +0200)
committerVojtech Vilimek <vojtech.vilimek@nic.cz>
Fri, 14 Apr 2023 09:30:55 +0000 (11:30 +0200)
filter/trie.c
filter/trie_test.c

index 3738416c8b8dc853df5e7b095e5260e51a630832..288a4d13fb4c1333315280c6da5c4c9387a797f1 100644 (file)
@@ -854,9 +854,8 @@ trie_walk_init(struct f_trie_walk_state *s, const struct f_trie *t, const net_ad
       /* Save the last node on the stack otherwise */
       else
       {
-       /* Found prefect match, no advancing */
+       /* Found perfect match, no advancing of stack position */
        s->stack[s->stack_pos] = n;
-       /* Search whole trie except skipped parts */
        s->start_pos = 1;
       }
 
index 6e21b0a8954ae315c88eb05dd6c74be4cc3fb532..37bbbd1bca30529473938637265b40c4b09aee56 100644 (file)
@@ -911,13 +911,13 @@ t_trie_walk_inclusive(void)
       bt_format_net(buf, 64, &px->net);
       bt_debug("%s{%d,%d}\n", buf, px->lo, px->hi);
     }
-    */
  
     /* Full walk */
     bt_debug("Full walk inclusive (round %d, %d nets)\n", round, num);
 
     pos = 0;
     uint pxc = 0;
+    /* Last argument should have no effect on the walk */
     TRIE_WALK2(trie, net, NULL, 1)
     {
       log_networks(&net, &pxset[pos].net);
@@ -978,9 +978,9 @@ t_trie_walk_inclusive(void)
        break;
 
       /* Account for subnets before searched net from */
-    for (; pos < num; pos++)
-      if (net_compare(&pxset[pos].net, &from.net) >= 0)
-        break;
+    //for (; pos < num; pos++)
+      //if (net_compare(&pxset[pos].net, &from.net) >= 0)
+        //break;
 
     int p0 = pos;
     char buf0[64];