From: Igor Putovny Date: Thu, 29 Feb 2024 13:46:07 +0000 (+0100) Subject: Clear bit after setting it when collecting prefixes from trie X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9619284d2009ce0a5b15e2b48cf0202f7818022d;p=thirdparty%2Fbird.git Clear bit after setting it when collecting prefixes from trie --- diff --git a/proto/aggregator/aggregator.c b/proto/aggregator/aggregator.c index b1b23fd32..647476e59 100644 --- a/proto/aggregator/aggregator.c +++ b/proto/aggregator/aggregator.c @@ -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); } }