|SUCCESS| [v2, 5/5] test/fib6: reproduce table overwrite on address wraparound

dpdklab at iol.unh.edu dpdklab at iol.unh.edu
Tue Oct 27 16:39:57 CET 2026


Test-Label: ai-code-review
Test-Status: SUCCESS
https://dpdk.org/patch/172180

_AI Code Review_

=== Patch Review: series.patch (via Claude) ===
Review date: 2026-10-27

# DPDK Patch Review

## Patch 1/5: rib: fix undefined behavior in bit test

### Errors

None.

### Warnings

None.

### Info

None.

---

## Patch 2/5: fib: fix full table overwrite on address wraparound

### Errors

None.

### Warnings

None.

### Info

None.

---

## Patch 3/5: fib6: fix full table overwrite on address wraparound

### Errors

None.

### Warnings

None.

### Info

None.

---

## Patch 4/5: test/fib: reproduce table overwrite on address wraparound

### Errors

None.

### Warnings

None.

### Info

None.

---

## Patch 5/5: test/fib6: reproduce table overwrite on address wraparound

### Errors

None.

### Warnings

None.

### Info

None.

---

## Summary

This patch series fixes three related correctness bugs in DPDK's routing table (RIB/FIB) libraries and adds comprehensive test coverage for the fixes:

**Patch 1/5** fixes undefined behavior in `rte_rib.c` where `1 << 31` on a signed `int` is undefined. The fix correctly uses `1U` to produce an unsigned constant, ensuring well-defined behavior for all shift counts 0-31. The undefined behavior occurs when a depth-0 route exists (default route or common parent spanning both halves of the address space). This is a correctness bug that could manifest as unpredictable behavior.

**Patches 2/5 and 3/5** fix silent table corruption bugs in `dir24_8.c` (IPv4) and `trie.c` (IPv6) respectively. Both functions have a loop that walks routes under a modified prefix to fill gaps with the correct next hop. When the last route ends at the top of the address space (255.255.255.255 or ffff:...:ffff) and its starting edge equals the current left edge, the code advances `ledge` past it, causing wraparound to 0 or ::. Without a wraparound check, the loop continues and the final `install_to_fib()` / `install_to_dp()` call with both edges at 0 overwrites the entire routing table. The corruption is silent (returns 0). The fixes add the missing wraparound checks, matching the pattern already present in a different branch of the same functions.

**Patches 4/5 and 5/5** add functional tests that reproduce the table corruption bugs fixed by patches 2 and 3. Without the fixes, these tests fail (lookups return wrong next hops). With the fixes, they pass. The tests cover both deletion of a default route with /1 children spanning the full space, and addition of a covering prefix over routes at the top of the address space.

All patches are well-structured, clearly documented, correctly apply the `Fixes:` and `Cc: stable at dpdk.org` tags for backporting, and follow DPDK coding conventions. The test infrastructure correctly uses `TEST_ASSERT` macros and integrates with the existing test suite.

Review-Result: CLEAN


More information about the test-report mailing list