diff options
author | João Valverde <j@v6e.pt> | 2022-10-07 11:28:22 +0100 |
---|---|---|
committer | A Wireshark GitLab Utility <gerald+gitlab-utility@wireshark.org> | 2022-10-08 09:51:49 +0000 |
commit | 14f5121c4ac9420abd013af75f44065acdd0e49f (patch) | |
tree | 180f01ae378a2609d781d0067149149a36f9e15b /test | |
parent | 2c56c0bad696194d6a8b013ae3174eb08cd6be0c (diff) |
dfilter: Remove problematic <...> literal syntax
The <...> syntax for literals, intended to be as generic as
possible, unintentionally introduced an ambiguity with the
relational expression "a < b or a > c".
Literals are values like numbers, bytes, IPv6 addresses or, one
could imagine, UNC paths for example, if an FT_UNC type were to
be added in the future.
We could use a new unique symbol like @...@ but the <...>
syntax is very recent and may not be necessary with ":xxx" so
just remove it.
A byte array can be explicitly declared by prefixing with a colon. It
is not as generic but the main ambiguity that this new syntax attempted
to solve is bytes vs protocol names. We don't want to introduce a new
reserved symbol for now, until other requirements if any are more clear.
Fixes #18418.
Diffstat (limited to 'test')
-rw-r--r-- | test/suite_dfilter/group_syntax.py | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/test/suite_dfilter/group_syntax.py b/test/suite_dfilter/group_syntax.py index 010a8a990e..f13aaa82f2 100644 --- a/test/suite_dfilter/group_syntax.py +++ b/test/suite_dfilter/group_syntax.py @@ -119,6 +119,11 @@ class case_syntax(unittest.TestCase): dfilter = "tcp.flags.push == FALSE" checkDFilterCount(dfilter, 0) + def test_misc_1(self, checkDFilterSucceed): + # Issue #18418 + dfilter = "icmp and ((icmp.type > 0 and icmp.type < 8) or icmp.type > 8)" + checkDFilterSucceed(dfilter) + @fixtures.uses_fixtures class case_equality(unittest.TestCase): trace_file = "sip.pcapng" @@ -147,10 +152,6 @@ class case_equality(unittest.TestCase): dfilter = "udp.port == :5070" checkDFilterCount(dfilter, 3) - def test_literal_2(self, checkDFilterCount): - dfilter = "udp contains <ce:13>" - checkDFilterCount(dfilter, 1) - def test_literal_3(self, checkDFilterCount): dfilter = "frame[0:10] contains :00:01:6c" checkDFilterCount(dfilter, 1) @@ -177,11 +178,6 @@ class case_equality(unittest.TestCase): dfilter = 'frame[37] == :fc' checkDFilterCount(dfilter, 1) - def test_rhs_literal_bias_3(self, checkDFilterCount): - # Byte 0xFC on the RHS - dfilter = 'frame[37] == <fc>' - checkDFilterCount(dfilter, 1) - def test_rhs_literal_bias_4(self, checkDFilterCount): # Protocol "Fibre Channel" on the RHS dfilter = 'frame[37] == .fc' |