Skip to content

lpm: reject disjoint prefix queries - #183

Merged
joamaki merged 1 commit into
cilium:mainfrom
immanuwell:fix/lpm-disjoint-prefix
Aug 26, 2026
Merged

lpm: reject disjoint prefix queries#183
joamaki merged 1 commit into
cilium:mainfrom
immanuwell:fix/lpm-disjoint-prefix

Conversation

@immanuwell

@immanuwell immanuwell commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

A disjoint Prefix query could return an unrelated LPM subtree when traversal hit a compressed node

Repro:

  1. Insert only 10.0.0.0/8
  2. Query Prefix with 192.168.0.0/16
  3. The 10/8 object comes back

The fix returns no iterator when matching diverges inside a node.
Added trie and public NetIPPrefixIndex regression tests

Tests: make

Signed-off-by: immanuwell <pchpr.00@list.ru>
@immanuwell
immanuwell requested a review from a team as a code owner August 26, 2026 06:02
@immanuwell
immanuwell requested review from derailed and removed request for a team August 26, 2026 06:02
@joamaki
joamaki requested review from joamaki and removed request for derailed August 26, 2026 11:09
@joamaki

joamaki commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Thanks for the PR. LGTM. FYI, found some other issues in the lpm implementation with Codex and I'll do a follow-up PRs on those, so maybe hold off on further fixes until I've posted the PRs?

@joamaki
joamaki merged commit 3fca4cd into cilium:main Aug 26, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants