diff options
author | Florian Westphal <fw@strlen.de> | 2023-09-28 23:27:55 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2023-11-03 12:24:21 +0100 |
commit | dc36708b9b209823f3ee8912f1d72c272bbd36da (patch) | |
tree | adfb72a46bd3c3ab2036a210007ea87b0e1cc0a6 /tests/py/bridge/vlan.t.payload | |
parent | fba8fbeb18225f9d4952fa61fb5a263ae07a26ee (diff) |
rule: never merge across non-expression statements
commit 99ab1b8feb16741a83fb8b887bacae8fa07d29a2 upstream.
The existing logic can merge across non-expression statements,
if there is only one payload expression.
Example:
ether saddr 00:11:22:33:44:55 counter ether type 8021q
is turned into
counter ether saddr 00:11:22:33:44:55 ether type 8021q
which isn't the same thing.
Fix this up and add test cases for adjacent vlan and ip header
fields. 'Counter' serves as a non-merge fence.
Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'tests/py/bridge/vlan.t.payload')
-rw-r--r-- | tests/py/bridge/vlan.t.payload | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/py/bridge/vlan.t.payload b/tests/py/bridge/vlan.t.payload index 62e4b89b..2592bb96 100644 --- a/tests/py/bridge/vlan.t.payload +++ b/tests/py/bridge/vlan.t.payload @@ -304,3 +304,11 @@ bridge test-bridge input [ payload load 2b @ link header + 14 => reg 10 ] [ bitwise reg 10 = ( reg 10 & 0x0000ff0f ) ^ 0x00000000 ] [ lookup reg 1 set __set%d ] + +# ether saddr 00:11:22:33:44:55 counter ether type 8021q +bridge test-bridge input + [ payload load 6b @ link header + 6 => reg 1 ] + [ cmp eq reg 1 0x33221100 0x00005544 ] + [ counter pkts 0 bytes 0 ] + [ payload load 2b @ link header + 12 => reg 1 ] + [ cmp eq reg 1 0x00000081 ] |