From 9fb076dc773e30f274ecc426fa36592644864951 Mon Sep 17 00:00:00 2001 From: Jan Maria Matejka Date: Wed, 26 Sep 2018 16:41:18 +0200 Subject: [PATCH] Protocol: Linpool is not needed in preexport hook, removing. --- nest/proto-hooks.c | 10 ++++------ nest/protocol.h | 2 +- nest/rt-show.c | 2 +- nest/rt-table.c | 4 ++-- proto/babel/babel.c | 2 +- proto/bgp/attrs.c | 2 +- proto/bgp/bgp.h | 2 +- proto/ospf/ospf.c | 4 ++-- proto/pipe/pipe.c | 2 +- proto/radv/radv.c | 2 +- sysdep/unix/krt.c | 2 +- 11 files changed, 16 insertions(+), 18 deletions(-) diff --git a/nest/proto-hooks.c b/nest/proto-hooks.c index bc88b4b4..234115d9 100644 --- a/nest/proto-hooks.c +++ b/nest/proto-hooks.c @@ -261,22 +261,20 @@ void store_tmp_attrs(rte *e, ea_list *attrs) * preexport - pre-filtering decisions before route export * @p: protocol instance the route is going to be exported to * @e: the route in question - * @attrs: extended attributes of the route - * @pool: linear pool for allocation of all temporary data * * The preexport() hook is called as the first step of a exporting - * a route from a routing table to the protocol instance. It can modify - * route attributes and force acceptance or rejection of the route before + * a route from a routing table to the protocol instance. It can + * force acceptance or rejection of the route before * the user-specified filters are run. See rte_announce() for a complete description * of the route distribution process. * * The standard use of this hook is to reject routes having originated - * from the same instance and to set default values of the protocol's metrics. + * from the same instance. * * Result: 1 if the route has to be accepted, -1 if rejected and 0 if it * should be passed to the filters. */ -int preexport(struct proto *p, rte **e, ea_list **attrs, struct linpool *pool) +int preexport(struct proto *p, rte **e) { DUMMY; } /** diff --git a/nest/protocol.h b/nest/protocol.h index b62c1508..8f63ec4d 100644 --- a/nest/protocol.h +++ b/nest/protocol.h @@ -209,7 +209,7 @@ struct proto { void (*neigh_notify)(struct neighbor *neigh); struct ea_list *(*make_tmp_attrs)(struct rte *rt, struct linpool *pool); void (*store_tmp_attrs)(struct rte *rt); - int (*preexport)(struct proto *, struct rte **rt, struct linpool *pool); + int (*preexport)(struct proto *, struct rte **rt); void (*reload_routes)(struct channel *); void (*feed_begin)(struct channel *, int initial); void (*feed_end)(struct channel *); diff --git a/nest/rt-show.c b/nest/rt-show.c index c7bcdf2f..533d2afe 100644 --- a/nest/rt-show.c +++ b/nest/rt-show.c @@ -133,7 +133,7 @@ rt_show_net(struct cli *c, net *n, struct rt_show_data *d) else if (d->export_mode) { struct proto *ep = ec->proto; - int ic = ep->preexport ? ep->preexport(ep, &e, c->show_pool) : 0; + int ic = ep->preexport ? ep->preexport(ep, &e) : 0; if (ec->ra_mode == RA_OPTIMAL || ec->ra_mode == RA_MERGED) pass = 1; diff --git a/nest/rt-table.c b/nest/rt-table.c index a343638b..709dad2c 100644 --- a/nest/rt-table.c +++ b/nest/rt-table.c @@ -405,7 +405,7 @@ export_filter(struct channel *c, rte *rt0, rte **rt_free, linpool *pool, int sil rte_make_tmp_attrs(&rt, pool); - v = p->preexport ? p->preexport(p, &rt, pool) : 0; + v = p->preexport ? p->preexport(p, &rt) : 0; if (v < 0) { if (silent) @@ -1420,7 +1420,7 @@ rt_examine(rtable *t, net_addr *a, struct proto *p, struct filter *filter, struc /* Rest is stripped down export_filter() */ rte_make_tmp_attrs(&rt, lp); - int v = p->preexport ? p->preexport(p, &rt, lp) : 0; + int v = p->preexport ? p->preexport(p, &rt) : 0; if (v == RIC_PROCESS) v = (f_run(filter, &rt, lp, FF_SILENT) <= F_ACCEPT); diff --git a/proto/babel/babel.c b/proto/babel/babel.c index 1f52658e..61bf3f60 100644 --- a/proto/babel/babel.c +++ b/proto/babel/babel.c @@ -2095,7 +2095,7 @@ babel_prepare_attrs(struct linpool *pool, ea_list *next, uint metric, u64 router static int -babel_preexport(struct proto *P, struct rte **new, struct linpool *pool UNUSED) +babel_preexport(struct proto *P, struct rte **new) { struct rta *a = (*new)->attrs; diff --git a/proto/bgp/attrs.c b/proto/bgp/attrs.c index 14061ae4..9f55c8dd 100644 --- a/proto/bgp/attrs.c +++ b/proto/bgp/attrs.c @@ -1365,7 +1365,7 @@ bgp_free_prefix(struct bgp_channel *c, struct bgp_prefix *px) */ int -bgp_preexport(struct proto *P, rte **new, struct linpool *pool UNUSED) +bgp_preexport(struct proto *P, rte **new) { rte *e = *new; struct proto *SRC = e->attrs->src->proto; diff --git a/proto/bgp/bgp.h b/proto/bgp/bgp.h index ced09a81..bbbceb9f 100644 --- a/proto/bgp/bgp.h +++ b/proto/bgp/bgp.h @@ -531,7 +531,7 @@ int bgp_rte_mergable(rte *pri, rte *sec); int bgp_rte_recalculate(rtable *table, net *net, rte *new, rte *old, rte *old_best); struct rte *bgp_rte_modify_stale(struct rte *r, struct linpool *pool); void bgp_rt_notify(struct proto *P, struct channel *C, net *n, rte *new, rte *old); -int bgp_preexport(struct proto *, struct rte **, struct linpool *); +int bgp_preexport(struct proto *, struct rte **); int bgp_get_attr(struct eattr *e, byte *buf, int buflen); void bgp_get_route_info(struct rte *, byte *buf); diff --git a/proto/ospf/ospf.c b/proto/ospf/ospf.c index 6336fad6..0a784ed8 100644 --- a/proto/ospf/ospf.c +++ b/proto/ospf/ospf.c @@ -101,7 +101,7 @@ #include #include "ospf.h" -static int ospf_preexport(struct proto *P, rte **new, struct linpool *pool); +static int ospf_preexport(struct proto *P, rte **new); static struct ea_list *ospf_make_tmp_attrs(struct rte *rt, struct linpool *pool); static void ospf_store_tmp_attrs(struct rte *rt); static void ospf_reload_routes(struct channel *C); @@ -446,7 +446,7 @@ ospf_disp(timer * timer) * import to the filters. */ static int -ospf_preexport(struct proto *P, rte **new, struct linpool *pool UNUSED) +ospf_preexport(struct proto *P, rte **new) { struct ospf_proto *p = (struct ospf_proto *) P; struct ospf_area *oa = ospf_main_area(p); diff --git a/proto/pipe/pipe.c b/proto/pipe/pipe.c index 7dcad637..7e1d03c1 100644 --- a/proto/pipe/pipe.c +++ b/proto/pipe/pipe.c @@ -101,7 +101,7 @@ pipe_rt_notify(struct proto *P, struct channel *src_ch, net *n, rte *new, rte *o } static int -pipe_preexport(struct proto *P, rte **ee, struct linpool *p UNUSED) +pipe_preexport(struct proto *P, rte **ee) { struct proto *pp = (*ee)->sender->proto; diff --git a/proto/radv/radv.c b/proto/radv/radv.c index 38f49131..465bd969 100644 --- a/proto/radv/radv.c +++ b/proto/radv/radv.c @@ -396,7 +396,7 @@ radv_net_match_trigger(struct radv_config *cf, net *n) } int -radv_preexport(struct proto *P, rte **new, struct linpool *pool UNUSED) +radv_preexport(struct proto *P, rte **new) { // struct radv_proto *p = (struct radv_proto *) P; struct radv_config *cf = (struct radv_config *) (P->cf); diff --git a/sysdep/unix/krt.c b/sysdep/unix/krt.c index bfc82990..334654ec 100644 --- a/sysdep/unix/krt.c +++ b/sysdep/unix/krt.c @@ -934,7 +934,7 @@ krt_store_tmp_attrs(rte *rt) } static int -krt_preexport(struct proto *P, rte **new, struct linpool *pool UNUSED) +krt_preexport(struct proto *P, rte **new) { // struct krt_proto *p = (struct krt_proto *) P; rte *e = *new;