summaryrefslogtreecommitdiff
path: root/nest/rt-show.c
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2019-09-09 02:55:32 +0200
committerOndrej Zajicek (work) <santiago@crfreenet.org>2019-11-26 18:39:25 +0100
commit5ea39eaa96625ec8274703b1eb2c8f59042a8a32 (patch)
tree0ef3675d3818b86b2ee2c9edaf6663cdf153bbe9 /nest/rt-show.c
parentaf02b83b888c693c292960072195f0e1caf1d2a1 (diff)
Nest: Use bitmaps to keep track of exported routes
Use a hierarchical bitmap in a routing table to assign ids to routes, and then use bitmaps (indexed by route id) in channels to keep track whether routes were exported. This avoids unreliable and inefficient re-evaluation of filters for old routes in order to determine whether they were exported.
Diffstat (limited to 'nest/rt-show.c')
-rw-r--r--nest/rt-show.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/nest/rt-show.c b/nest/rt-show.c
index 5114e5f0..0318f4f0 100644
--- a/nest/rt-show.c
+++ b/nest/rt-show.c
@@ -120,9 +120,17 @@ rt_show_net(struct cli *c, net *n, struct rt_show_data *d)
if (ec && (ec->export_state == ES_DOWN))
goto skip;
- /* Special case for merged export */
- if ((d->export_mode == RSEM_EXPORT) && (ec->ra_mode == RA_MERGED))
+ if (d->export_mode == RSEM_EXPORTED)
+ {
+ if (!bmap_test(&ec->export_map, ee->id))
+ goto skip;
+
+ // if (ec->ra_mode != RA_ANY)
+ // pass = 1;
+ }
+ else if ((d->export_mode == RSEM_EXPORT) && (ec->ra_mode == RA_MERGED))
{
+ /* Special case for merged export */
rte *rt_free;
e = rt_export_merged(ec, n, &rt_free, c->show_pool, 1);
pass = 1;