Commit 95488885 authored by Jan Maria Matejka's avatar Jan Maria Matejka Committed by Maria Matejka

Nest: Don't make tmp_attr before preexport is called

parent 3e60932a
...@@ -405,8 +405,6 @@ export_filter_(struct channel *c, rte *rt0, rte **rt_free, linpool *pool, int si ...@@ -405,8 +405,6 @@ export_filter_(struct channel *c, rte *rt0, rte **rt_free, linpool *pool, int si
rt = rt0; rt = rt0;
*rt_free = NULL; *rt_free = NULL;
rte_make_tmp_attrs(&rt, pool);
v = p->preexport ? p->preexport(p, &rt, pool) : 0; v = p->preexport ? p->preexport(p, &rt, pool) : 0;
if (v < 0) if (v < 0)
{ {
...@@ -425,6 +423,8 @@ export_filter_(struct channel *c, rte *rt0, rte **rt_free, linpool *pool, int si ...@@ -425,6 +423,8 @@ export_filter_(struct channel *c, rte *rt0, rte **rt_free, linpool *pool, int si
goto accept; goto accept;
} }
rte_make_tmp_attrs(&rt, pool);
v = filter && ((filter == FILTER_REJECT) || v = filter && ((filter == FILTER_REJECT) ||
(f_run(filter, &rt, pool, (f_run(filter, &rt, pool,
(silent ? FF_SILENT : 0)) > F_ACCEPT)); (silent ? FF_SILENT : 0)) > F_ACCEPT));
...@@ -1477,12 +1477,14 @@ rt_examine(rtable *t, net_addr *a, struct proto *p, struct filter *filter) ...@@ -1477,12 +1477,14 @@ rt_examine(rtable *t, net_addr *a, struct proto *p, struct filter *filter)
rte_update_lock(); rte_update_lock();
/* Rest is stripped down export_filter() */ /* Rest is stripped down export_filter() */
rte_make_tmp_attrs(&rt, rte_update_pool);
int v = p->preexport ? p->preexport(p, &rt, rte_update_pool) : 0; int v = p->preexport ? p->preexport(p, &rt, rte_update_pool) : 0;
if (v == RIC_PROCESS) if (v == RIC_PROCESS)
{
rte_make_tmp_attrs(&rt, rte_update_pool);
v = (f_run(filter, &rt, rte_update_pool, FF_SILENT) <= F_ACCEPT); v = (f_run(filter, &rt, rte_update_pool, FF_SILENT) <= F_ACCEPT);
}
/* Discard temporary rte */ /* Discard temporary rte */
if (rt != n->routes) if (rt != n->routes)
rte_free(rt); rte_free(rt);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment