|SUCCESS| [2/2] test: add test for IPv6 fragmentation id
dpdklab at iol.unh.edu
dpdklab at iol.unh.edu
Sat Nov 21 18:16: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: the code comment and commit message claim RFC 7739 unpredictability, but `rte_rand()` is a linear generator.
```
frag_id = (rte_be32_t)rte_rand();
```
Every fragment puts these IDs on the wire. An observer who collects enough of them can, in principle, recover the generator state and predict later IDs. That is the off-path attack RFC 7739 is meant to prevent. This does satisfy the RFC 8200 requirement that IDs be distinct per packet, which is the main functional fix.
If real unpredictability is the goal, a keyed-hash scheme is closer to what RFC 7739 section 5 describes. One option is SipHash over (src, dst, counter) with a secret seeded once from `getrandom()`. Otherwise, soften the comment so it does not claim RFC 7739 compliance.
**Patch 2/2: test: add test for IPv6 fragmentation id**
Info: the output fragments leak if the length assertion fails with a positive count other than 2.
```
RTE_TEST_ASSERT_EQUAL(len, 2, "Failed to fragment packet %zd.",
i);
```
`RTE_TEST_ASSERT_EQUAL` returns immediately on failure. If `len` is, say, 3, the fragments already in `pkts_out` are never released. The fix is to free `pkts_out` when `len > 0` before failing. This is test-only and minor.
Info: `%zd` is used to print `i`, which is a `size_t`.
```
"Fragments of packet %zd differ in id.",
```
The matching specifier for `size_t` is `%zu`. Both format strings should use it.
Info: the final check compares two random 32-bit IDs.
```
RTE_TEST_ASSERT_NOT_EQUAL(ids[0], ids[1],
```
This fails spuriously with probability 2^-32 per run. That rate is negligible, but the test is technically non-deterministic.
Review-Result: CLEAN
More information about the test-report
mailing list