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/ospf/ospf.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'proto/ospf/ospf.c') diff --git a/proto/ospf/ospf.c b/proto/ospf/ospf.c index f9aa6cd1..22150590 100644 --- a/proto/ospf/ospf.c +++ b/proto/ospf/ospf.c @@ -107,7 +107,7 @@ #include #include "ospf.h" -static int ospf_preexport(struct proto *P, rte *new); +static int ospf_preexport(struct channel *C, rte *new); static void ospf_reload_routes(struct channel *C); static int ospf_rte_better(struct rte *new, struct rte *old); static u32 ospf_rte_igp_metric(struct rte *rt); @@ -482,13 +482,13 @@ ospf_disp(timer * timer) * import to the filters. */ static int -ospf_preexport(struct proto *P, rte *e) +ospf_preexport(struct channel *c, rte *e) { - struct ospf_proto *p = (struct ospf_proto *) P; + struct ospf_proto *p = (struct ospf_proto *) c->proto; struct ospf_area *oa = ospf_main_area(p); /* Reject our own routes */ - if (e->src->proto == P) + if (e->src->proto == c->proto) return -1; /* Do not export routes to stub areas */ -- cgit v1.2.3