From: Maria Matejka Date: Mon, 18 Mar 2019 11:57:47 +0000 (+0100) Subject: Merge branch 'master' into HEAD X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9bb992cce55238424007eb64e996b0d191d53d39;p=thirdparty%2Fbird.git Merge branch 'master' into HEAD --- 9bb992cce55238424007eb64e996b0d191d53d39 diff --cc nest/rt-table.c index c3e1a2543,0b7962289..5df3605b3 --- a/nest/rt-table.c +++ b/nest/rt-table.c @@@ -423,10 -593,10 +593,10 @@@ export_filter_(struct channel *c, rte * goto accept; } - rte_make_tmp_attrs(&rt, pool); + rte_make_tmp_attrs(&rt, pool, NULL); v = filter && ((filter == FILTER_REJECT) || - (f_run(filter, &rt, pool, + (f_run(&(c->out_filter), &rt, pool, (silent ? FF_SILENT : 0)) > F_ACCEPT)); if (v) { @@@ -1415,26 -1573,27 +1585,27 @@@ rte_update2(struct channel *c, const ne /* new is a private copy, i could modify it */ new->flags |= REF_FILTERED; } - else + else if (filter) { - rte_make_tmp_attrs(&new, rte_update_pool); - if (filter && (filter != FILTER_REJECT)) - { - ea_list *oldea = new->attrs->eattrs; - int fr = f_run(&(c->in_filter), &new, rte_update_pool, 0); - if (fr > F_ACCEPT) - { - stats->imp_updates_filtered++; - rte_trace_in(D_FILTERS, p, new, "filtered out"); + rta *old_attrs; + rte_make_tmp_attrs(&new, rte_update_pool, &old_attrs); - if (! c->in_keep_filtered) - goto drop; - int fr = f_run(filter, &new, rte_update_pool, 0); ++ int fr = f_run(&(c->in_filter), &new, rte_update_pool, 0); + if (fr > F_ACCEPT) + { + stats->imp_updates_filtered++; + rte_trace_in(D_FILTERS, p, new, "filtered out"); - new->flags |= REF_FILTERED; - } - if (new->attrs->eattrs != oldea && src->proto->store_tmp_attrs) - src->proto->store_tmp_attrs(new); + if (! c->in_keep_filtered) + { + rta_free(old_attrs); + goto drop; } + + new->flags |= REF_FILTERED; + } + + rte_store_tmp_attrs(new, rte_update_pool, old_attrs); } if (!rta_is_cached(new->attrs)) /* Need to copy attributes */ new->attrs = rta_lookup(new->attrs); @@@ -1531,8 -1690,8 +1702,8 @@@ rt_examine(rtable *t, net_addr *a, stru int v = p->preexport ? p->preexport(p, &rt, rte_update_pool) : 0; if (v == RIC_PROCESS) { - rte_make_tmp_attrs(&rt, rte_update_pool); + rte_make_tmp_attrs(&rt, rte_update_pool, NULL); - v = (f_run(filter, &rt, rte_update_pool, FF_SILENT) <= F_ACCEPT); + v = (f_run(filter_slot, &rt, rte_update_pool, FF_SILENT | FF_TEMP) <= F_ACCEPT); } /* Discard temporary rte */ diff --cc proto/mrt/mrt.c index 5769a44bf,e4f1acea2..db6d5c2d4 --- a/proto/mrt/mrt.c +++ b/proto/mrt/mrt.c @@@ -496,10 -496,9 +496,10 @@@ mrt_rib_table_dump(struct mrt_table_dum continue; } - rte_make_tmp_attrs(&rt, s->linpool); + rte_make_tmp_attrs(&rt, s->linpool, NULL); - if (f_run(s->filter, &rt, s->linpool, 0) <= F_ACCEPT) + struct filter_slot fs = { .filter = s->filter }; + if (f_run(&(fs), &rt, s->linpool, FF_TEMP) <= F_ACCEPT) mrt_rib_table_entry(s, rt); if (rt != rt0)