From ecf855b2f58f1718a6a1c3dcde13b140557844ec Mon Sep 17 00:00:00 2001 From: Florian Westphal Date: Fri, 7 Aug 2015 20:52:04 +0200 Subject: tests: add two test cases using binop w. payload [ payload load 4b @ network header + 12 => reg 1 ] [ bitwise reg 1 = (reg=1 & 0xff000000 ) ^ 0x00000000 ] [ cmp eq reg 1 ... .. to make sure that later support to match header elements that have odd (non-byte aligned) lengths/offsets doesn't erronously eliminate explicitly added binops while searching expressions for implicit binops. Signed-off-by: Florian Westphal --- tests/regression/ip/ip.t.payload.inet | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'tests/regression/ip/ip.t.payload.inet') diff --git a/tests/regression/ip/ip.t.payload.inet b/tests/regression/ip/ip.t.payload.inet index be635cdb..1a2b1b5c 100644 --- a/tests/regression/ip/ip.t.payload.inet +++ b/tests/regression/ip/ip.t.payload.inet @@ -441,3 +441,19 @@ inet test-inet input [ cmp eq reg 1 0x0200a8c0 ] [ log prefix (null) ] +# ip saddr \& 0xff == 1 +inet test-inet input + [ meta load nfproto => reg 1 ] + [ cmp eq reg 1 0x00000002 ] + [ payload load 4b @ network header + 12 => reg 1 ] + [ bitwise reg 1 = (reg=1 & 0xff000000 ) ^ 0x00000000 ] + [ cmp eq reg 1 0x01000000 ] + +# ip saddr \& 0.0.0.255 \< 0.0.0.127 +inet test-inet input + [ meta load nfproto => reg 1 ] + [ cmp eq reg 1 0x00000002 ] + [ payload load 4b @ network header + 12 => reg 1 ] + [ bitwise reg 1 = (reg=1 & 0xff000000 ) ^ 0x00000000 ] + [ cmp lt reg 1 0x7f000000 ] + -- cgit v1.2.3