diff options
author | Xiao Liang <shaw.leon@gmail.com> | 2021-08-21 00:12:37 +0800 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2021-08-23 16:34:52 +0200 |
commit | bd6ba14bebd27181ee18cfc3aebb21a78d96d672 (patch) | |
tree | 5e88ef776bfc3e6f6b418239d51b218689f76417 /tests/py/any/meta.t.payload | |
parent | ffde58ab86507755ba7049a00dde5c4df6f26fbe (diff) |
src: Optimize prefix match only if is big-endian
A prefix of integer type is big-endian in nature. Prefix match can be
optimized to truncated 'cmp' only if it is big-endian.
[ Add one tests/py for this use-case --pablo ]
Fixes: 25338cdb6c77 ("src: Optimize prefix matches on byte-boundaries")
Signed-off-by: Xiao Liang <shaw.leon@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'tests/py/any/meta.t.payload')
-rw-r--r-- | tests/py/any/meta.t.payload | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/py/any/meta.t.payload b/tests/py/any/meta.t.payload index b79a0255..d8351c27 100644 --- a/tests/py/any/meta.t.payload +++ b/tests/py/any/meta.t.payload @@ -155,6 +155,12 @@ ip test-ip4 input [ meta load mark => reg 1 ] [ cmp neq reg 1 0x00000010 ] +# meta mark 0xffffff00/24 +ip test-ip4 input + [ meta load mark => reg 1 ] + [ bitwise reg 1 = ( reg 1 & 0xffffff00 ) ^ 0x00000000 ] + [ cmp eq reg 1 0xffffff00 ] + # meta mark or 0x03 == 0x01 ip test-ip4 input [ meta load mark => reg 1 ] |