|SUCCESS| [2/2] test: add test for IPv6 fragmentation id
dpdklab at iol.unh.edu
dpdklab at iol.unh.edu
Sat Nov 21 18:34:57 CET 2026
Test-Label: ai-code-review
Test-Status: SUCCESS
https://dpdk.org/patch/173096
_AI Code Review_
=== Patch Review: series.patch (via Claude) ===
Review date: 2026-11-21
**Patch 1/2: ip_frag: generate a fragment identification for IPv6**
Info: `rte_rand()` does not provide the unpredictability the comment and commit message claim.
```
+ * RFC 8200 wants it distinct per packet, RFC 7739 unpredictable.
+ */
+ frag_id = (rte_be32_t)rte_rand();
```
- `rte_rand()` is an LFSR-based generator, so it is linear. An observer who collects enough fragment IDs from the wire can recover the state and predict later IDs.
- That falls short of RFC 7739's goal of resisting ID prediction by off-path attackers.
- This is not key material, so it is not an Error. It does fix the real problem of all-zero IDs.
- Either soften the comment to "distinct per packet", or note that a stronger, possibly per-destination, scheme would be needed for full RFC 7739 compliance.
**Patch 2/2: test: add test for IPv6 fragmentation id**
Info: output fragments leak when the fragment count assertion fails.
```
+ len = rte_ipv6_fragment_packet(b, pkts_out, BURST, 1280,
+ direct_pool, indirect_pool);
+ rte_pktmbuf_free(b);
+ RTE_TEST_ASSERT_EQUAL(len, 2, "Failed to fragment packet %zd.",
+ i);
```
- If `rte_ipv6_fragment_packet()` returns a positive count other than 2, the assertion returns early.
- The `len` mbufs in `pkts_out` are then never freed. This affects only the test's failure path.
- Fix: free them before asserting.
```
if (len > 0 && len != 2)
test_free_fragments(pkts_out, len);
```
Info: the wrong format specifier is used for a `size_t` value.
```
+ "Fragments of packet %zd differ in id.",
```
- `i` is `size_t`, which is unsigned, so the specifier should be `%zu` rather than `%zd`.
- The same applies to the `"Failed to fragment packet %zd."` message.
Review-Result: CLEAN
More information about the test-report
mailing list