1
0
mirror of https://gitlab.labs.nic.cz/labs/bird.git synced 2024-05-11 16:54:54 +00:00

Merge commit 'f2f3163f6c3fba7f9ef03640d7b2f6323873d2cc' into haugesund

This commit is contained in:
Maria Matejka
2022-05-30 16:41:15 +02:00
15 changed files with 110 additions and 58 deletions

View File

@@ -133,7 +133,7 @@ cmd_eval(const struct f_line *expr)
buffer buf;
LOG_BUFFER_INIT(buf);
if (f_eval_buf(expr, this_cli->parser_pool, &buf) > F_RETURN)
if (f_eval_buf(expr, &buf) > F_RETURN)
{
cli_msg(8008, "runtime error");
return;

View File

@@ -198,7 +198,7 @@ rt_show_net(struct cli *c, net *n, struct rt_show_data *d)
* command may change the export filter and do not update routes.
*/
int do_export = (ic > 0) ||
(f_run(ec->out_filter, &e, c->show_pool, FF_SILENT) <= F_ACCEPT);
(f_run(ec->out_filter, &e, FF_SILENT) <= F_ACCEPT);
if (do_export != (d->export_mode == RSEM_EXPORT))
goto skip;
@@ -211,7 +211,7 @@ rt_show_net(struct cli *c, net *n, struct rt_show_data *d)
if (d->show_protocol && (d->show_protocol != e.src->proto))
goto skip;
if (f_run(d->filter, &e, c->show_pool, 0) > F_ACCEPT)
if (f_run(d->filter, &e, 0) > F_ACCEPT)
goto skip;
if (d->stats < 2)

View File

@@ -735,7 +735,7 @@ rte_feed_obtain(net *n, struct rte **feed, uint count)
}
static rte *
export_filter_(struct channel *c, rte *rt, linpool *pool, int silent)
export_filter(struct channel *c, rte *rt, int silent)
{
struct proto *p = c->proto;
const struct filter *filter = c->out_filter;
@@ -765,7 +765,7 @@ export_filter_(struct channel *c, rte *rt, linpool *pool, int silent)
}
v = filter && ((filter == FILTER_REJECT) ||
(f_run(filter, rt, pool,
(f_run(filter, rt,
(silent ? FF_SILENT : 0)) > F_ACCEPT));
if (v)
{
@@ -791,12 +791,6 @@ reject_noset:
return NULL;
}
static inline rte *
export_filter(struct channel *c, rte *rt, int silent)
{
return export_filter_(c, rt, rte_update_pool, silent);
}
static void
do_rt_notify(struct channel *c, const net_addr *net, rte *new, const rte *old)
{
@@ -972,7 +966,7 @@ rt_export_merged(struct channel *c, struct rte **feed, uint count, linpool *pool
return NULL;
rloc = *best0;
best = export_filter_(c, &rloc, pool, silent);
best = export_filter(c, &rloc, silent);
if (!best)
/* Best route doesn't pass the filter */
@@ -988,7 +982,7 @@ rt_export_merged(struct channel *c, struct rte **feed, uint count, linpool *pool
continue;
rte tmp0 = *feed[i];
rte *tmp = export_filter_(c, &tmp0, pool, 1);
rte *tmp = export_filter(c, &tmp0, 1);
if (!tmp || !rte_is_reachable(tmp))
continue;
@@ -1556,7 +1550,7 @@ rte_update_direct(struct channel *c, const net_addr *n, rte *new, struct rte_src
new = NULL;
}
else if ((filter == FILTER_REJECT) ||
((fr = f_run(filter, new, rte_update_pool, 0)) > F_ACCEPT))
((fr = f_run(filter, new, 0)) > F_ACCEPT))
{
stats->updates_filtered++;
channel_rte_trace_in(D_FILTERS, c, new, "filtered out");
@@ -1653,7 +1647,7 @@ rt_examine(rtable *t, net_addr *a, struct channel *c, const struct filter *filte
/* Rest is stripped down export_filter() */
int v = c->proto->preexport ? c->proto->preexport(c, &rt) : 0;
if (v == RIC_PROCESS)
v = (f_run(filter, &rt, rte_update_pool, FF_SILENT) <= F_ACCEPT);
v = (f_run(filter, &rt, FF_SILENT) <= F_ACCEPT);
rte_update_unlock();