diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2016-09-20 19:25:25 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2016-10-17 17:55:56 +0200 |
commit | 3ed932917cc744b489bd2706a55a1778b0b50c0e (patch) | |
tree | 96f226969cab52a9c29510378612751713f78d98 /tests/py/ip/ip.t.payload | |
parent | f55ccf9ea1061f8e50065c0cc6b3ed93523f0b97 (diff) |
src: use new range expression for != [a,b] intervals
Use new range expression in the kernel to fix wrong bytecode generation.
This patch also adjust tests so we don't hit problems there.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'tests/py/ip/ip.t.payload')
-rw-r--r-- | tests/py/ip/ip.t.payload | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/tests/py/ip/ip.t.payload b/tests/py/ip/ip.t.payload index 4c7bd7df..fade387e 100644 --- a/tests/py/ip/ip.t.payload +++ b/tests/py/ip/ip.t.payload @@ -50,8 +50,7 @@ ip test-ip4 input # ip length != 333-453 ip test-ip4 input [ payload load 2b @ network header + 2 => reg 1 ] - [ cmp lt reg 1 0x00004d01 ] - [ cmp gt reg 1 0x0000c501 ] + [ range neq reg 1 0x00004d01 0x0000c501 ] # ip length { 333, 553, 673, 838} __set%d test-ip4 3 @@ -88,8 +87,7 @@ ip test-ip4 input # ip id != 33-45 ip test-ip4 input [ payload load 2b @ network header + 4 => reg 1 ] - [ cmp lt reg 1 0x00002100 ] - [ cmp gt reg 1 0x00002d00 ] + [ range neq reg 1 0x00002100 0x00002d00 ] # ip id { 33, 55, 67, 88} __set%d test-ip4 3 @@ -127,8 +125,7 @@ ip test-ip4 input # ip frag-off != 33-45 ip test-ip4 input [ payload load 2b @ network header + 6 => reg 1 ] - [ cmp lt reg 1 0x00002100 ] - [ cmp gt reg 1 0x00002d00 ] + [ range neq reg 1 0x00002100 0x00002d00 ] # ip frag-off { 33, 55, 67, 88} __set%d test-ip4 3 @@ -166,8 +163,7 @@ ip test-ip4 input # ip ttl != 45-50 ip test-ip4 input [ payload load 1b @ network header + 8 => reg 1 ] - [ cmp lt reg 1 0x0000002d ] - [ cmp gt reg 1 0x00000032 ] + [ range neq reg 1 0x0000002d 0x00000032 ] # ip ttl {43, 53, 45 } __set%d test-ip4 3 @@ -234,8 +230,7 @@ ip test-ip4 input # ip checksum != 33-45 ip test-ip4 input [ payload load 2b @ network header + 10 => reg 1 ] - [ cmp lt reg 1 0x00002100 ] - [ cmp gt reg 1 0x00002d00 ] + [ range neq reg 1 0x00002100 0x00002d00 ] # ip checksum { 33, 55, 67, 88} __set%d test-ip4 3 @@ -307,8 +302,7 @@ ip test-ip4 input # ip daddr != 192.168.0.1-192.168.0.250 ip test-ip4 input [ payload load 4b @ network header + 16 => reg 1 ] - [ cmp lt reg 1 0x0100a8c0 ] - [ cmp gt reg 1 0xfa00a8c0 ] + [ range neq reg 1 0x0100a8c0 0xfa00a8c0 ] # ip daddr { 192.168.0.1-192.168.0.250} __set%d test-ip4 7 @@ -336,8 +330,7 @@ ip test-ip4 input # ip daddr != 192.168.1.2-192.168.1.55 ip test-ip4 input [ payload load 4b @ network header + 16 => reg 1 ] - [ cmp lt reg 1 0x0201a8c0 ] - [ cmp gt reg 1 0x3701a8c0 ] + [ range neq reg 1 0x0201a8c0 0x3701a8c0 ] # ip saddr 192.168.1.3-192.168.33.55 ip test-ip4 input @@ -348,8 +341,7 @@ ip test-ip4 input # ip saddr != 192.168.1.3-192.168.33.55 ip test-ip4 input [ payload load 4b @ network header + 12 => reg 1 ] - [ cmp lt reg 1 0x0301a8c0 ] - [ cmp gt reg 1 0x3721a8c0 ] + [ range neq reg 1 0x0301a8c0 0x3721a8c0 ] # ip daddr 192.168.0.1 ip test-ip4 input |