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

Filters always allocate from tmp_linpool

This commit is contained in:
Maria Matejka
2022-04-10 18:55:15 +02:00
parent de86040b2c
commit f2f3163f6c
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

@@ -169,7 +169,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;
@@ -182,7 +182,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

@@ -713,7 +713,7 @@ rte_trace_out(uint flag, struct channel *c, rte *e, char *msg)
}
static rte *
export_filter_(struct channel *c, rte *rt0, rte **rt_free, linpool *pool, int silent)
export_filter(struct channel *c, rte *rt0, rte **rt_free, int silent)
{
struct proto *p = c->proto;
const struct filter *filter = c->out_filter;
@@ -743,7 +743,7 @@ export_filter_(struct channel *c, rte *rt0, rte **rt_free, linpool *pool, int si
}
v = filter && ((filter == FILTER_REJECT) ||
(f_run(filter, &rt, pool,
(f_run(filter, &rt,
(silent ? FF_SILENT : 0)) > F_ACCEPT));
if (v)
{
@@ -767,12 +767,6 @@ export_filter_(struct channel *c, rte *rt0, rte **rt_free, linpool *pool, int si
return NULL;
}
static inline rte *
export_filter(struct channel *c, rte *rt0, rte **rt_free, int silent)
{
return export_filter_(c, rt0, rt_free, rte_update_pool, silent);
}
static void
do_rt_notify(struct channel *c, net *net, rte *new, rte *old, int refeed)
{
@@ -963,7 +957,7 @@ rt_export_merged(struct channel *c, net *net, rte **rt_free, linpool *pool, int
if (!rte_is_valid(best0))
return NULL;
best = export_filter_(c, best0, rt_free, pool, silent);
best = export_filter(c, best0, rt_free, silent);
if (!best || !rte_is_reachable(best))
return best;
@@ -973,7 +967,7 @@ rt_export_merged(struct channel *c, net *net, rte **rt_free, linpool *pool, int
if (!rte_mergable(best0, rt0))
continue;
rt = export_filter_(c, rt0, &tmp, pool, 1);
rt = export_filter(c, rt0, &tmp, 1);
if (!rt)
continue;
@@ -1592,7 +1586,7 @@ rte_update2(struct channel *c, const net_addr *n, rte *new, struct rte_src *src)
}
else if (filter)
{
int fr = f_run(filter, &new, rte_update_pool, 0);
int fr = f_run(filter, &new, 0);
if (fr > F_ACCEPT)
{
stats->imp_updates_filtered++;
@@ -1696,7 +1690,7 @@ rt_examine(rtable *t, net_addr *a, struct proto *p, const struct filter *filter)
/* Rest is stripped down export_filter() */
int v = p->preexport ? p->preexport(p, 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);
/* Discard temporary rte */
if (rt != n->routes)