diff options
author | Mikael Magnusson <mikma@users.sourceforge.net> | 2023-11-26 00:33:22 +0100 |
---|---|---|
committer | Mikael Magnusson <mikma@users.sourceforge.net> | 2023-11-26 00:33:22 +0100 |
commit | e693a8241cc5fd868c02a0ef34c191d0ee77e957 (patch) | |
tree | 5fa750b7429b9bc5543e0145f90e543eeafa265b | |
parent | 3f04c0149da0a43defd8b798a8837964d2d239c6 (diff) |
WIP: f-inst improvementswireguard-next-tmp8
-rw-r--r-- | filter/f-inst.c | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/filter/f-inst.c b/filter/f-inst.c index 33663329..b26facb0 100644 --- a/filter/f-inst.c +++ b/filter/f-inst.c @@ -826,13 +826,6 @@ eattr *e = ea_find(eal, da.ea_code); if (!e) { - /* A special case for tunnel encap */ - if (da.type == EAF_TYPE_TUNNEL_ENCAP) { - RESULT_(T_TLVLIST, tl, NULL); - runtime("Can't get null tunnel encap"); - break; - } - RESULT_VAL(val_empty(da.f_type)); break; } @@ -1339,10 +1332,10 @@ ARG(2, T_SET); METHOD_CONSTRUCTOR("add"); - if (subtlv_set_type(v2.val.t)) - RESULT(T_TLVLIST, tl, [[ tlv_set_add(fpool, v1.val.tl, tlv_alloc(fpool, v2.val.t)) ]]); - else - runtime("Can't add non-tlv"); + if (!subtlv_set_type(v2.val.t)) + runtime("Mismatched set type"); + + RESULT(T_TLVLIST, tl, [[ tlv_set_add(fpool, v1.val.tl, tlv_alloc(fpool, v2.val.t)) ]]); } INST(FI_TLVLIST_ADD_TLVLIST, 2, 1) { @@ -1547,30 +1540,30 @@ RESULT(T_LCLIST, ad, [[ lclist_filter(fpool, v1.val.ad, &v2, 1) ]]); } - INST(FI_TLVLIST_FILTER_TLVLIST, 2, 1) { + INST(FI_TLVLIST_FILTER_SET, 2, 1) { ARG(1, T_TLVLIST); ARG(2, T_SET); METHOD_CONSTRUCTOR("filter"); + if (!subtlv_set_type(v2.val.t)) + runtime("Mismatched set type"); + #if 0 RESULT(T_TLVLIST, tl, [[ tlvlist_filter(fpool, v1.val.tl, &v2, 1) ]]); #else - runtime("FI_TLVLIST_FILTER_TLVLIST disabled"); + runtime("FI_TLVLIST_FILTER_SET disabled"); #endif } - INST(FI_TLVLIST_FILTER_SET, 2, 1) { + INST(FI_TLVLIST_FILTER_TLVLIST, 2, 1) { ARG(1, T_TLVLIST); ARG(2, T_TLVLIST); METHOD_CONSTRUCTOR("filter"); - if (!subtlv_set_type(v2.val.t)) - runtime("Mismatched set type"); - #if 0 RESULT(T_TLVLIST, tl, [[ tlvlist_filter(fpool, v1.val.tl, &v2, 1) ]]); #else - runtime("FI_TLVLIST_FILTER_SET disabled"); + runtime("FI_TLVLIST_FILTER_TLVLIST disabled"); #endif } |