Fixes: 4b0f2a712b579 ("src: support for arp sender and target ethernet and IPv4 addresses") Signed-off-by: Phil Sutter <phil@xxxxxx> --- tests/py/arp/arp.t.json | 64 ++++++++++++++++++++++++++++++++++ tests/py/arp/arp.t.json.output | 14 ++++---- 2 files changed, 70 insertions(+), 8 deletions(-) diff --git a/tests/py/arp/arp.t.json b/tests/py/arp/arp.t.json index 4b0439e6edd58..0ea62645bbf6a 100644 --- a/tests/py/arp/arp.t.json +++ b/tests/py/arp/arp.t.json @@ -816,6 +816,70 @@ } ] +# arp saddr ip 1.2.3.4 +[ + { + "match": { + "left": { + "payload": { + "field": "saddr ip", + "protocol": "arp" + } + }, + "op": "==", + "right": "1.2.3.4" + } + } +] + +# arp daddr ip 4.3.2.1 +[ + { + "match": { + "left": { + "payload": { + "field": "daddr ip", + "protocol": "arp" + } + }, + "op": "==", + "right": "4.3.2.1" + } + } +] + +# arp saddr ether aa:bb:cc:aa:bb:cc +[ + { + "match": { + "left": { + "payload": { + "field": "saddr ether", + "protocol": "arp" + } + }, + "op": "==", + "right": "aa:bb:cc:aa:bb:cc" + } + } +] + +# arp daddr ether aa:bb:cc:aa:bb:cc +[ + { + "match": { + "left": { + "payload": { + "field": "daddr ether", + "protocol": "arp" + } + }, + "op": "==", + "right": "aa:bb:cc:aa:bb:cc" + } + } +] + # meta iifname "invalid" arp ptype 0x0800 arp htype 1 arp hlen 6 arp plen 4 @nh,192,32 0xc0a88f10 @nh,144,48 set 0x112233445566 [ { diff --git a/tests/py/arp/arp.t.json.output b/tests/py/arp/arp.t.json.output index 4053d94763de5..b8507bffc8cc4 100644 --- a/tests/py/arp/arp.t.json.output +++ b/tests/py/arp/arp.t.json.output @@ -129,25 +129,23 @@ "match": { "left": { "payload": { - "base": "nh", - "len": 32, - "offset": 192 + "field": "daddr ip", + "protocol": "arp" } }, "op": "==", - "right": 3232272144 + "right": "192.168.143.16" } }, { "mangle": { "key": { "payload": { - "base": "nh", - "len": 48, - "offset": 144 + "field": "daddr ether", + "protocol": "arp" } }, - "value": 18838586676582 + "value": "11:22:33:44:55:66" } } ] -- 2.21.0