diff options
author | João Valverde <j@v6e.pt> | 2023-07-24 23:12:08 +0100 |
---|---|---|
committer | João Valverde <j@v6e.pt> | 2023-07-25 12:17:25 +0000 |
commit | ca8976020ff82f802ae8c3ab72ea4491f8c6dc1e (patch) | |
tree | ef18eea1c5e7fa4ebb7e8bd6d5ccc2710dd54c37 /epan/dfilter/sttype-op.c | |
parent | 1b82eda9ebb72a4ac5198a44072f8694ffc1e060 (diff) |
dfilter: Change "not in" behaviour to match inequality
"A not in S" is now implemented as "A and A not_in S"
instead of "not (A in S)".
"not A in S" is implemented as "not A or A not_in S".
This is to be consistent with the way inequality has historically
worked, where "A != B" is not the same as "not A == B".
Maybe we should change both propositions to have inequality
be the same as not equality instead.
Fixes #19187.
Diffstat (limited to 'epan/dfilter/sttype-op.c')
-rw-r--r-- | epan/dfilter/sttype-op.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/epan/dfilter/sttype-op.c b/epan/dfilter/sttype-op.c index d11686c17c..c75cf25169 100644 --- a/epan/dfilter/sttype-op.c +++ b/epan/dfilter/sttype-op.c @@ -134,6 +134,9 @@ oper_todisplay(const oper_t *oper) case STNODE_OP_IN: s = "in"; break; + case STNODE_OP_NOT_IN: + s = "not in"; + break; case STNODE_OP_UNINITIALIZED: s = "<uninitialized>"; break; @@ -210,6 +213,9 @@ oper_todebug(const oper_t *oper) case STNODE_OP_IN: s = "TEST_IN"; break; + case STNODE_OP_NOT_IN: + s = "TEST_NOT_IN"; + break; case STNODE_OP_UNINITIALIZED: s = "<uninitialized>"; break; @@ -261,6 +267,7 @@ num_operands(stnode_op_t op) case STNODE_OP_CONTAINS: case STNODE_OP_MATCHES: case STNODE_OP_IN: + case STNODE_OP_NOT_IN: return 2; } ws_assert_not_reached(); |