diff options
author | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2020-03-26 03:57:48 +0100 |
---|---|---|
committer | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2020-03-26 03:57:48 +0100 |
commit | 27550028907fd135051a43dda0abe76e9118b7e9 (patch) | |
tree | d8d68c7906b92a68ffccb090d93da0bf400e3379 /nest/rt-table.c | |
parent | d516c68ad838351fa5e20e3e10bd3fb2b3157618 (diff) |
Filter: Optimize IPv4 prefix sets
Use separate IPv4 and IPv6 implementation of prefix sets. Just this
change makes IPv4 prefix sets 60% smaller and 50% faster.
Diffstat (limited to 'nest/rt-table.c')
-rw-r--r-- | nest/rt-table.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/nest/rt-table.c b/nest/rt-table.c index f95afccd..a46eeb77 100644 --- a/nest/rt-table.c +++ b/nest/rt-table.c @@ -2789,7 +2789,7 @@ rt_init_hostcache(rtable *tab) hc->slab = sl_new(rt_table_pool, sizeof(struct hostentry)); hc->lp = lp_new(rt_table_pool, LP_GOOD_SIZE(1024)); - hc->trie = f_new_trie(hc->lp, sizeof(struct f_trie_node)); + hc->trie = f_new_trie(hc->lp, 0); tab->hostcache = hc; } @@ -2943,7 +2943,7 @@ rt_update_hostcache(rtable *tab) /* Reset the trie */ lp_flush(hc->lp); - hc->trie = f_new_trie(hc->lp, sizeof(struct f_trie_node)); + hc->trie = f_new_trie(hc->lp, 0); WALK_LIST_DELSAFE(n, x, hc->hostentries) { |