summaryrefslogtreecommitdiff
path: root/nest/rt-table.c
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2022-06-27 19:04:22 +0200
committerMaria Matejka <mq@ucw.cz>2022-06-27 19:04:24 +0200
commitbeb5f78ada79ac90f31f2c4923302c74d9ab38bf (patch)
treeb6f37568d57428d7bc9df103c84922b1076e1f5e /nest/rt-table.c
parentb867c798c3e42c875311a79fe53a36d4a5bfd126 (diff)
Preexport callback now takes the channel instead of protocol as argument
Passing protocol to preexport was in fact a historical relic from the old times when channels weren't a thing. Refactoring that to match current extensibility needs.
Diffstat (limited to 'nest/rt-table.c')
-rw-r--r--nest/rt-table.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/nest/rt-table.c b/nest/rt-table.c
index 2cf55421..a2fa5e77 100644
--- a/nest/rt-table.c
+++ b/nest/rt-table.c
@@ -870,7 +870,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, pool) : 0;
+ v = p->preexport ? p->preexport(c, &rt, pool) : 0;
if (v < 0)
{
if (silent)
@@ -1883,8 +1883,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;
@@ -1894,7 +1895,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, rte_update_pool) : 0;
+ int v = p->preexport ? p->preexport(c, &rt, rte_update_pool) : 0;
if (v == RIC_PROCESS)
{
rte_make_tmp_attrs(&rt, rte_update_pool, NULL);