On 14/06/2026 14:16, Simon Glass wrote:
Hi Mateusz,
On 2026-06-10T14:25:33, Mateusz Furdyna <[email protected]> wrote:
test: net: add IP defragmentation duplicate-fragment regression test
Add a unit test for the IP datagram reassembler (CONFIG_IP_DEFRAG) that
covers the duplicate-last-fragment scenario.
Without the fix the last fragment will re-trigger datagram delivery,
increasing udp_rx_count to 2 and effectively failing the test; with it
applied the test passes with udp_rx_count == 1.
Signed-off-by: Mateusz Furdyna <[email protected]>
test/dm/Makefile | 1 +
test/dm/net_defrag.c | 82 ++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 83 insertions(+)
Reviewed-by: Simon Glass <[email protected]>
diff --git a/test/dm/net_defrag.c b/test/dm/net_defrag.c
@@ -0,0 +1,82 @@
+DM_TEST(dm_test_net_ip_defrag_dup_last, 0);
Just to check, does this test actually use driver model?
No, it doesn't. It drives net_process_received_packet() directly,
nothing is actually using DM in the test path.
I'd followed the existing precedent in test/dm/eth.c
(dm_test_string_to_ip6(), which similarly doesn't exercise DM), which is
what prompted my earlier question about whether "ut dm" was the right
home for this (and stopped me for looking further, my bad).
I'm happy to move it to the lib suite, for instance. Since Jerome has
already queued this v2 for net/master: should I create v3, a follow-up
on top of what's queued or just leave it as-is in DM?
Regards,
Simon
Best Regards,
Mateusz