summaryrefslogtreecommitdiffstats
path: root/tests/py/ip/ip.t.payload.inet
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2016-06-06 21:52:28 +0200
committerFlorian Westphal <fw@strlen.de>2016-06-07 00:54:22 +0200
commit3503738f77cdbe521da1054a37f59ac2e442b4cf (patch)
tree144d072b8baee81558c1334b47c5d7186d888f2c /tests/py/ip/ip.t.payload.inet
parentba145d3ee951c5c90cd00bb317f06ddbb0451539 (diff)
payload: don't update protocol context if we can't find a description
Since commit 20b1131c07acd2fc ("payload: fix stacked headers protocol context tracking") we deref null pointer if we can't find a description for the desired protocol, so "ip protocol 254" crashes while testing protocols 6 or 17 (tcp, udp) works. Also add a test case for this. Closes: https://bugzilla.netfilter.org/show_bug.cgi?id=1072 Signed-off-by: Florian Westphal <fw@strlen.de> Acked-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'tests/py/ip/ip.t.payload.inet')
-rw-r--r--tests/py/ip/ip.t.payload.inet7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/py/ip/ip.t.payload.inet b/tests/py/ip/ip.t.payload.inet
index ef4692e3..e495246e 100644
--- a/tests/py/ip/ip.t.payload.inet
+++ b/tests/py/ip/ip.t.payload.inet
@@ -268,6 +268,13 @@ inet test-inet input
[ lookup reg 1 set __set%d ]
[ immediate reg 0 accept ]
+# ip protocol 255
+ip test-ip4 input
+ [ meta load nfproto => reg 1 ]
+ [ cmp eq reg 1 0x00000002 ]
+ [ payload load 1b @ network header + 9 => reg 1 ]
+ [ cmp eq reg 1 0x000000ff ]
+
# ip checksum 13172 drop
inet test-inet input
[ meta load nfproto => reg 1 ]