summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2018-01-23 18:29:32 +0100
committerOndrej Zajicek (work) <santiago@crfreenet.org>2018-01-23 18:29:32 +0100
commit75d98b6013c19598b1d3ba5e05e8f84525e8678a (patch)
tree95089f2193c4097f26cddc0539f3a16e801fe0a5 /filter
parentace3072e09e445b2fd8554492b80bea5cc1f3411 (diff)
parentd6cf996151307d083c30e4ecde0f1d7449b19253 (diff)
Merge branch 'master' into int-new
Diffstat (limited to 'filter')
-rw-r--r--filter/filter.c9
-rw-r--r--filter/filter.h1
2 files changed, 7 insertions, 3 deletions
diff --git a/filter/filter.c b/filter/filter.c
index 4e17f974..42e60a68 100644
--- a/filter/filter.c
+++ b/filter/filter.c
@@ -587,7 +587,8 @@ val_format_str(struct f_val v) {
static struct tbf rl_runtime_err = TBF_DEFAULT_LOG_LIMITS;
#define runtime(fmt, ...) do { \
- log_rl(&rl_runtime_err, L_ERR "filters, line %d: " fmt, what->lineno, ##__VA_ARGS__); \
+ if (!(f_flags & FF_SILENT)) \
+ log_rl(&rl_runtime_err, L_ERR "filters, line %d: " fmt, what->lineno, ##__VA_ARGS__); \
res.type = T_RETURN; \
res.val.i = F_ERROR; \
return res; \
@@ -903,7 +904,8 @@ interpret(struct f_inst *what)
break;
case P('p',','):
ONEARG;
- if (what->a2.i == F_NOP || (what->a2.i != F_NONL && what->a1.p))
+ if ((what->a2.i == F_NOP || (what->a2.i != F_NONL && what->a1.p)) &&
+ !(f_flags & FF_SILENT))
log_commit(*L_INFO, &f_buf);
switch (what->a2.i) {
@@ -1793,7 +1795,8 @@ f_run(struct filter *filter, struct rte **rte, struct ea_list **tmp_attrs, struc
if (res.type != T_RETURN) {
- log_rl(&rl_runtime_err, L_ERR "Filter %s did not return accept nor reject. Make up your mind", filter->name);
+ if (!(f_flags & FF_SILENT))
+ log_rl(&rl_runtime_err, L_ERR "Filter %s did not return accept nor reject. Make up your mind", filter->name);
return F_ERROR;
}
DBG( "done (%u)\n", res.val.i );
diff --git a/filter/filter.h b/filter/filter.h
index 89cd80e6..49004c33 100644
--- a/filter/filter.h
+++ b/filter/filter.h
@@ -208,6 +208,7 @@ struct f_trie
#define NEW_F_VAL struct f_val * val; val = cfg_alloc(sizeof(struct f_val));
#define FF_FORCE_TMPATTR 1 /* Force all attributes to be temporary */
+#define FF_SILENT 2 /* Silent filter execution */
/* Bird Tests */
struct f_bt_test_suite {