Repository navigation
Fix MPLS parsing when ICMP lengths omit quote padding - #144
Merged
Merged
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
The targeted correction preserves bounds checks and longer offsets, with regression coverage and no unresolved findings.
0 open findings
What changed in this PR
Fixes ICMP extension offsets so MPLS labels are decoded when advertised quote lengths omit padding.
Changes:
- Enforces the 128-byte minimum while preserving larger advertised offsets.
- Adds captured-packet, IPv6, and truncated-quote regression tests.
- Updates the existing explicit-length fixture to use a 160-byte quote.
| File | Description |
|---|---|
| src/probe/correlate.rs | Corrects extension offsets and adds regression coverage. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This was referenced Oct 16, 2026
A zero length and a short non-zero length both clamp to the 128-byte minimum, so the legacy branch is redundant.
lance0
marked this pull request as ready for review
October 16, 2026 15:40
This was referenced Oct 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A router in the capture attached to #134 advertises a 68-byte original datagram but pads it to 128 bytes before the MPLS extension. ttl previously read probe payload bytes as an extension header and displayed no MPLS labels.
Honor RFC 4884's 128-byte minimum when locating extensions, including nonzero lengths that omit padding. Longer advertised quotes retain their actual offset. The reporter's packet is embedded as a regression test and now yields label 416760, TTL 1. IPv6 padding and truncated quotes are also covered; the existing compliant-length fixture now uses a valid 160-byte quote.
Validation:
cargo build --locked,cargo test --locked,cargo clippy --locked --all-targets -- -D warnings, andcargo fmt -- --check. The real-packet regression failed before the fix and passes afterward. Live router probing was not needed for this packet-decoding fix.Refs #134.