summaryrefslogtreecommitdiffstats
path: root/tests/py/ip6/ip6.t.payload.inet
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2020-10-27 17:33:15 +0100
committerPhil Sutter <phil@nwl.cc>2020-11-04 14:44:11 +0100
commit25338cdb6c77aa2f0977afbbb612571c9d325213 (patch)
treee18d5b58d9718ebb9ee21cb06f189eb94bf7a22c /tests/py/ip6/ip6.t.payload.inet
parent8a927c56d83ed0f78785011bd92a53edc25a0ca0 (diff)
src: Optimize prefix matches on byte-boundaries
If a prefix expression's length is on a byte-boundary, it is sufficient to just reduce the length passed to "cmp" expression. No need for explicit bitwise modification of data on LHS. The relevant code is already there, used for string prefix matches. There is one exception though, namely zero-length prefixes: Kernel doesn't accept zero-length "cmp" expressions, so keep them in the old code-path for now. This patch depends upon the previous one to correctly parse odd-sized payload matches but has to extend support for non-payload LHS as well. In practice, this is needed for "ct" expressions as they allow matching against IP address prefixes, too. Signed-off-by: Phil Sutter <phil@nwl.cc>
Diffstat (limited to 'tests/py/ip6/ip6.t.payload.inet')
-rw-r--r--tests/py/ip6/ip6.t.payload.inet5
1 files changed, 2 insertions, 3 deletions
diff --git a/tests/py/ip6/ip6.t.payload.inet b/tests/py/ip6/ip6.t.payload.inet
index d015c8ef..ffc9b9f5 100644
--- a/tests/py/ip6/ip6.t.payload.inet
+++ b/tests/py/ip6/ip6.t.payload.inet
@@ -604,9 +604,8 @@ inet test-inet input
inet test-inet input
[ meta load nfproto => reg 1 ]
[ cmp eq reg 1 0x0000000a ]
- [ payload load 16b @ network header + 8 => reg 1 ]
- [ bitwise reg 1 = (reg=1 & 0xffffffff 0xffffffff 0x00000000 0x00000000 ) ^ 0x00000000 0x00000000 0x00000000 0x00000000 ]
- [ cmp eq reg 1 0x00000000 0x00000000 0x00000000 0x00000000 ]
+ [ payload load 8b @ network header + 8 => reg 1 ]
+ [ cmp eq reg 1 0x00000000 0x00000000 ]
# ip6 saddr ::1 ip6 daddr ::2
inet test-inet input