|WARNING| [v6] examples/l3fwd: fix RFC 1812 checks

dpdklab at iol.unh.edu dpdklab at iol.unh.edu
Sat Nov 14 00:54:27 CET 2026


Test-Label: ai-code-review
Test-Status: WARNING
https://dpdk.org/patch/172886

_AI Code Review_

=== Patch Review: series.patch (via Claude) ===
Review date: 2026-11-13

**examples/l3fwd/l3fwd.h: unrelated, undocumented change to `lcore_conf` (Warning)**

```
-extern struct lcore_conf *lcore_conf[RTE_MAX_LCORE];
+extern struct lcore_conf lcore_conf[RTE_MAX_LCORE];
```

This changes the type of a global from an array of pointers to an array of structs. It has nothing to do with the RFC 1812 checks, and the commit message does not mention it. It looks like a rebase artifact.

- If it is intentional, it belongs in a separate patch with its own explanation and `Fixes:` tag.
- If it is not intentional, drop it from this patch.

Bundling it into a patch marked for stable backport means it would be backported without any review of its own.

**examples/l3fwd/l3fwd_em.h, l3fwd_lpm.h: unchecked subtraction can wrap the link length (Info)**

```
+	if (is_valid_ipv4_pkt(ipv4_hdr, m->pkt_len - sizeof(struct rte_ether_hdr),
```

If `m->pkt_len` were less than `sizeof(struct rte_ether_hdr)`, the unsigned subtraction would wrap to a huge value. That would defeat every `link_len` check in `is_valid_ipv4_pkt()`, including the one that now protects `rte_ipv4_cksum()` from reading out of bounds.

In practice the packet was already classified as IPv4 and the header pointer was taken at offset 14, so this is hardening only. Since this function exists to validate untrusted packets, consider a guard such as:

```c
if (m->pkt_len < sizeof(struct rte_ether_hdr) ||
		is_valid_ipv4_pkt(ipv4_hdr, m->pkt_len - sizeof(struct rte_ether_hdr),
			m->ol_flags) < 0) {
```

Review-Result: WARNING


More information about the test-report mailing list