summaryrefslogtreecommitdiff
path: root/nest
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2018-01-16 16:20:01 +0100
committerOndrej Zajicek (work) <santiago@crfreenet.org>2018-01-16 16:20:01 +0100
commitb94057911554e04df9b709f8354e2e220131096a (patch)
tree411495bfa60fccc6b685346f3fb6543ab54fed2f /nest
parent0ff86d054efa8005c5df943acf6d2122781d3175 (diff)
Filter: Allow silent filter execution
A filter should log messages only if executed explicitly (e.g., during route export or route import). When a filter is executed for technical reasons (e.g., to establish whether a route was exported before), it should run silently.
Diffstat (limited to 'nest')
-rw-r--r--nest/rt-table.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/nest/rt-table.c b/nest/rt-table.c
index bcb48b53..28fe5baa 100644
--- a/nest/rt-table.c
+++ b/nest/rt-table.c
@@ -273,7 +273,8 @@ export_filter_(struct announce_hook *ah, rte *rt0, rte **rt_free, ea_list **tmpa
}
v = filter && ((filter == FILTER_REJECT) ||
- (f_run(filter, &rt, tmpa, pool, FF_FORCE_TMPATTR) > F_ACCEPT));
+ (f_run(filter, &rt, tmpa, pool,
+ FF_FORCE_TMPATTR | (silent ? FF_SILENT : 0)) > F_ACCEPT));
if (v)
{
if (silent)
@@ -1298,7 +1299,8 @@ rt_examine(rtable *t, ip_addr prefix, int pxlen, struct proto *p, struct filter
ea_list *tmpa = rte_make_tmp_attrs(rt, rte_update_pool);
int v = p->import_control ? p->import_control(p, &rt, &tmpa, rte_update_pool) : 0;
if (v == RIC_PROCESS)
- v = (f_run(filter, &rt, &tmpa, rte_update_pool, FF_FORCE_TMPATTR) <= F_ACCEPT);
+ v = (f_run(filter, &rt, &tmpa, rte_update_pool,
+ FF_FORCE_TMPATTR | FF_SILENT) <= F_ACCEPT);
/* Discard temporary rte */
if (rt != n->routes)
@@ -2493,7 +2495,8 @@ 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(a->out_filter, &e, &tmpa, rte_update_pool, FF_FORCE_TMPATTR) <= F_ACCEPT);
+ (f_run(a->out_filter, &e, &tmpa, rte_update_pool,
+ FF_FORCE_TMPATTR | FF_SILENT) <= F_ACCEPT);
if (do_export != (d->export_mode == RSEM_EXPORT))
goto skip;