]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Clear bit after setting it when collecting prefixes from trie
authorIgor Putovny <igor.putovny@nic.cz>
Thu, 29 Feb 2024 13:46:07 +0000 (14:46 +0100)
committerIgor Putovny <igor.putovny@nic.cz>
Thu, 30 May 2024 10:30:00 +0000 (12:30 +0200)
proto/aggregator/aggregator.c

index b1b23fd32ac1c01c097a231cfb82dffea210f59f..647476e59c27a0e1b57687961c9c32198e977dcf 100644 (file)
@@ -637,6 +637,7 @@ print_prefixes_ip4_helper(const struct trie_node *node, struct net_addr_ip4 *add
     ip4_setbit(&addr->prefix, depth);
     addr->pxlen = depth + 1;
     print_prefixes_ip4_helper(node->child[1], addr, depth + 1);
+    ip4_clrbit(&addr->prefix, depth);
   }
 }
 
@@ -668,6 +669,7 @@ print_prefixes_ip6_helper(const struct trie_node *node, struct net_addr_ip6 *add
     ip6_setbit(&addr->prefix, depth);
     addr->pxlen = depth + 1;
     print_prefixes_ip6_helper(node->child[1], addr, depth + 1);
+    ip6_clrbit(&addr->prefix, depth);
   }
 }
 
@@ -749,6 +751,7 @@ collect_prefixes_helper_ip4(const struct trie_node *node, struct net_addr_ip4 *a
     ip4_setbit(&addr->prefix, depth);
     addr->pxlen = depth + 1;
     collect_prefixes_helper_ip4(node->child[1], addr, p, depth + 1, count);
+    ip4_clrbit(&addr->prefix, depth);
   }
 }
 
@@ -783,6 +786,7 @@ collect_prefixes_helper_ip6(const struct trie_node *node, struct net_addr_ip6 *a
     ip6_setbit(&addr->prefix, depth);
     addr->pxlen = depth + 1;
     collect_prefixes_helper_ip6(node->child[1], addr, p, depth + 1, count);
+    ip6_clrbit(&addr->prefix, depth);
   }
 }