From 5ea39eaa96625ec8274703b1eb2c8f59042a8a32 Mon Sep 17 00:00:00 2001 From: "Ondrej Zajicek (work)" Date: Mon, 9 Sep 2019 02:55:32 +0200 Subject: 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. --- nest/rt-show.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'nest/rt-show.c') 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; -- cgit v1.2.3