RFC 791 permits zero-payload last fragments, but common stacks
including the Linux kernel discard them.  Align the reassembly test
with that policy: use valid one-byte fragments, and update expectations
for duplicate handling (recirc flow and expiry coverage count).

Assisted-by: composer-2.5-fast, Cursor
Signed-off-by: Eli Britstein <[email protected]>
---
 tests/ofproto-dpif.at | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/tests/ofproto-dpif.at b/tests/ofproto-dpif.at
index ee6ac873d..7d6c71379 100644
--- a/tests/ofproto-dpif.at
+++ b/tests/ofproto-dpif.at
@@ -5536,23 +5536,24 @@ table=2 tcp actions=3
 AT_CHECK([ovs-ofctl -O OpenFlow11 replace-flows br0 flows.txt])
 
 dnl Test frag expiry.
-AT_CHECK([ovs-appctl netdev-dummy/receive p90 "0021853763af 0026b98cb0f9 0800 
4500 0014 0001 8192 40 06 3316 ac11370d ac11370b"])
+AT_CHECK([ovs-appctl netdev-dummy/receive p90 "0021853763af 0026b98cb0f9 0800 
4500 0015 0001 8192 40 06 3315 ac11370d ac11370b 00"])
 ovs-appctl time/warp 10000
-AT_CHECK([ovs-appctl netdev-dummy/receive p90 "0021853763af 0026b98cb0f9 0800 
4500 0014 0001 8192 40 06 3316 ac11370d ac11370b"])
+AT_CHECK([ovs-appctl netdev-dummy/receive p90 "0021853763af 0026b98cb0f9 0800 
4500 0015 0001 8192 40 06 3315 ac11370d ac11370b 00"])
 
 dnl Test that no packets flow.
-AT_CHECK([ovs-appctl dpctl/dump-flows filter=in_port\(90\) | sed 
s'/recirc(.*)/recirc(X)/'], [0], [dnl
+AT_CHECK([ovs-appctl dpctl/dump-flows filter=in_port\(90\) | sed 
s'/recirc(.*)/recirc(X)/' | sort], [0], [dnl
 flow-dump from the main thread:
 
recirc_id(0),in_port(90),packet_type(ns=0,id=0),eth(src=00:26:b9:8c:b0:f9),eth_type(0x0800),ipv4(src=172.17.55.13/128.0.0.0,proto=6,frag=later),
 packets:0, bytes:0, used:never, actions:ct(commit,zone=10),recirc(X)
+recirc_id(0x2),in_port(90),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(proto=6,frag=later),
 packets:0, bytes:0, used:never, actions:2
 ])
 
 dnl Expire second frag.
 ovs-appctl time/warp 10000
 
 dnl Test frag purge
-AT_CHECK([ovs-appctl netdev-dummy/receive p90 "0021853763af 0026b98cb0f9 0800 
4500 0014 0002 8192 40 06 3315 ac11370d ac11370b"])
+AT_CHECK([ovs-appctl netdev-dummy/receive p90 "0021853763af 0026b98cb0f9 0800 
4500 0015 0002 8192 40 06 3314 ac11370d ac11370b 00"])
 ovs-appctl time/warp 33000
-AT_CHECK([ovs-appctl netdev-dummy/receive p90 "0021853763af 0026b98cb0f9 0800 
4500 0014 0003 8192 40 06 3314 ac11370d ac11370b"])
+AT_CHECK([ovs-appctl netdev-dummy/receive p90 "0021853763af 0026b98cb0f9 0800 
4500 0015 0003 8192 40 06 3313 ac11370d ac11370b 00"])
 
 dnl Test that no packets flow.
 AT_CHECK([ovs-appctl dpctl/dump-flows filter=in_port\(90\) | sed 
s'/recirc(.*)/recirc(X)/'], [0], [dnl
@@ -5563,8 +5564,9 @@ 
recirc_id(0),in_port(90),packet_type(ns=0,id=0),eth(src=00:26:b9:8c:b0:f9),eth_t
 dnl Purge second frag
 ovs-appctl time/warp 33000
 
-dnl Make sure all four packets are counted properly in the coverage.
-AT_CHECK([ovs-appctl coverage/show | grep -c "^ipf.*total: 2"], [0], [2
+dnl Make sure expiry and purge counters reflect the four packets sent.
+dnl The duplicate second fragment is counted as overlap, not a second expiry.
+AT_CHECK([ovs-appctl coverage/show | grep -c "^ipf.*total: 2"], [0], [1
 ])
 
 zero1208=$(printf '%0*d' 2416 0)
-- 
2.43.0

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to