summaryrefslogtreecommitdiff
path: root/nest
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2022-07-11 10:41:17 +0200
committerMaria Matejka <mq@ucw.cz>2022-07-11 10:41:17 +0200
commitd429bc5c841a8e9d4c81786973edfa56d20a407e (patch)
tree3857e7791fa51588b5f0de16bf05b65754349067 /nest
parent7e9cede1fd1878fb4c00e793bccd0ca6c18ad452 (diff)
parentbeb5f78ada79ac90f31f2c4923302c74d9ab38bf (diff)
Merge commit 'beb5f78a' into backport
Diffstat (limited to 'nest')
-rw-r--r--nest/protocol.h2
-rw-r--r--nest/route.h2
-rw-r--r--nest/rt-show.c2
-rw-r--r--nest/rt-table.c7
4 files changed, 7 insertions, 6 deletions
diff --git a/nest/protocol.h b/nest/protocol.h
index d0810a8f..29d759ea 100644
--- a/nest/protocol.h
+++ b/nest/protocol.h
@@ -213,7 +213,7 @@ struct proto {
void (*ifa_notify)(struct proto *, unsigned flags, struct ifa *a);
void (*rt_notify)(struct proto *, struct channel *, struct network *net, struct rte *new, struct rte *old);
void (*neigh_notify)(struct neighbor *neigh);
- int (*preexport)(struct proto *, struct rte *rt);
+ int (*preexport)(struct channel *, struct rte *rt);
void (*reload_routes)(struct channel *);
void (*feed_begin)(struct channel *, int initial);
void (*feed_end)(struct channel *);
diff --git a/nest/route.h b/nest/route.h
index 6641a8d7..a4f19fc4 100644
--- a/nest/route.h
+++ b/nest/route.h
@@ -320,7 +320,7 @@ rte *rte_find(net *net, struct rte_src *src);
rte *rte_get_temp(struct rta *, struct rte_src *src);
void rte_update2(struct channel *c, const net_addr *n, rte *new, struct rte_src *src);
/* rte_update() moved to protocol.h to avoid dependency conflicts */
-int rt_examine(rtable *t, net_addr *a, struct proto *p, const struct filter *filter);
+int rt_examine(rtable *t, net_addr *a, struct channel *c, const struct filter *filter);
rte *rt_export_merged(struct channel *c, net *net, rte **rt_free, linpool *pool, int silent);
void rt_refresh_begin(rtable *t, struct channel *c);
void rt_refresh_end(rtable *t, struct channel *c);
diff --git a/nest/rt-show.c b/nest/rt-show.c
index 19877966..183d023c 100644
--- a/nest/rt-show.c
+++ b/nest/rt-show.c
@@ -153,7 +153,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) : 0;
+ int ic = ep->preexport ? ep->preexport(ec, 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 19bed165..97bbc4f0 100644
--- a/nest/rt-table.c
+++ b/nest/rt-table.c
@@ -725,7 +725,7 @@ export_filter_(struct channel *c, rte *rt0, rte **rt_free, linpool *pool, int si
rt = rt0;
*rt_free = NULL;
- v = p->preexport ? p->preexport(p, rt) : 0;
+ v = p->preexport ? p->preexport(c, rt) : 0;
if (v < 0)
{
if (silent)
@@ -1683,8 +1683,9 @@ rte_modify(rte *old)
/* Check rtable for best route to given net whether it would be exported do p */
int
-rt_examine(rtable *t, net_addr *a, struct proto *p, const struct filter *filter)
+rt_examine(rtable *t, net_addr *a, struct channel *c, const struct filter *filter)
{
+ struct proto *p = c->proto;
net *n = net_find(t, a);
rte *rt = n ? n->routes : NULL;
@@ -1694,7 +1695,7 @@ rt_examine(rtable *t, net_addr *a, struct proto *p, const struct filter *filter)
rte_update_lock();
/* Rest is stripped down export_filter() */
- int v = p->preexport ? p->preexport(p, rt) : 0;
+ int v = p->preexport ? p->preexport(c, rt) : 0;
if (v == RIC_PROCESS)
v = (f_run(filter, &rt, rte_update_pool, FF_SILENT) <= F_ACCEPT);