diff options
author | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2019-08-06 18:54:19 +0200 |
---|---|---|
committer | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2019-08-06 18:54:19 +0200 |
commit | 9f3e09832081bc029dc98ae6dda49ee86d138fde (patch) | |
tree | 9bb699abd5e9aa4b188188514b04c0bb22b95b72 /filter/f-inst.c | |
parent | ef113c6f725349a2ab52f3cbef18403f82c84134 (diff) |
Filter: Allow to use set constants / expressions in path masks
Allow to not only use set literals in path masks, but also existing
set constants or set expressions.
Diffstat (limited to 'filter/f-inst.c')
-rw-r--r-- | filter/f-inst.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/filter/f-inst.c b/filter/f-inst.c index 0867ac4a..49ae993a 100644 --- a/filter/f-inst.c +++ b/filter/f-inst.c @@ -308,12 +308,24 @@ case T_PATH_MASK_ITEM: pm->item[i] = vv(i).val.pmi; break; + case T_INT: pm->item[i] = (struct f_path_mask_item) { .asn = vv(i).val.i, .kind = PM_ASN, }; break; + + case T_SET: + if (vv(i).val.t->from.type != T_INT) + runtime("Only integer sets allowed in path mask"); + + pm->item[i] = (struct f_path_mask_item) { + .set = vv(i).val.t, + .kind = PM_ASN_SET, + }; + break; + default: runtime( "Error resolving path mask template: value not an integer" ); } |