From 69d1ffde4c724882398b3b630ea1199f12c0c288 Mon Sep 17 00:00:00 2001 From: Maria Matejka Date: Tue, 28 Jan 2020 11:42:46 +0100 Subject: Split route data structure to storage (ro) / manipulation (rw) structures. Routes are now allocated only when they are just to be inserted to the table. Updating a route needs a locally allocated route structure. Ownership of the attributes is also now not transfered from protocols to tables and vice versa but just borrowed which should be easier to handle in a multithreaded environment. --- proto/rpki/rpki.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'proto/rpki') diff --git a/proto/rpki/rpki.c b/proto/rpki/rpki.c index be3d19ab..72fbc967 100644 --- a/proto/rpki/rpki.c +++ b/proto/rpki/rpki.c @@ -127,19 +127,16 @@ rpki_table_add_roa(struct rpki_cache *cache, struct channel *channel, const net_ .dest = RTD_NONE, }; - rta *a = rta_lookup(&a0); - rte *e = rte_get_temp(a, p->p.main_source); + rte e0 = { .attrs = &a0, .src = p->p.main_source, }; - e->pflags = 0; - - rte_update2(channel, &pfxr->n, e, e->src); + rte_update(channel, &pfxr->n, &e0, p->p.main_source); } void rpki_table_remove_roa(struct rpki_cache *cache, struct channel *channel, const net_addr_union *pfxr) { struct rpki_proto *p = cache->p; - rte_update2(channel, &pfxr->n, NULL, p->p.main_source); + rte_update(channel, &pfxr->n, NULL, p->p.main_source); } -- cgit v1.2.3