Skip to content

ethernet-padding - #1787

Merged
daniel-noland merged 2 commits into
mainfrom
pr/daniel-noland/vxlan-padding
Sep 2, 2026
Merged

ethernet-padding#1787
daniel-noland merged 2 commits into
mainfrom
pr/daniel-noland/vxlan-padding

Conversation

@daniel-noland

@daniel-noland daniel-noland commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

Restores the transport-checksum fix that reached main on 2026-08-29 and was undone on
2026-09-01, and pins the behaviour with properties that cover the only way the fabric actually meets ethernet padding: inside a VXLAN tunnel.

@daniel-noland
daniel-noland requested a review from a team as a code owner September 1, 2026 18:57
@daniel-noland
daniel-noland requested review from Fredi-raspall and removed request for a team September 1, 2026 18:57
@daniel-noland
daniel-noland force-pushed the pr/daniel-noland/vxlan-padding branch from 52f1d7e to 56a958f Compare September 1, 2026 18:58
@codecov

codecov Bot commented Sep 1, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.62447% with 8 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
net/src/packet/mod.rs 96.44% 4 Missing and 4 partials ⚠️

📢 Thoughts on this report? Let us know!

@daniel-noland daniel-noland changed the title fix(net): Restore the ethernet-padding checksum bound, and pin it through VXLAN restore the ethernet-padding checksum bound Sep 1, 2026
@coderabbitai

coderabbitai Bot commented Sep 1, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Essentials

Run ID: 84f5c113-022c-48c5-bdf2-9bd8bf26821a

📥 Commits

Reviewing files that changed from the base of the PR and between 9ab6f3b and bb5cd4c.

📒 Files selected for processing (2)
  • net/src/headers/mod.rs
  • net/src/packet/mod.rs

Included review availability: 4 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.


📝 Walkthrough

Walkthrough

Changes

Transport payload checksum bounds

Layer / File(s) Summary
Transport payload length derivation
net/src/headers/mod.rs
Headers::transport_payload_len derives the remaining transport payload length from IPv4 or IPv6 headers and returns None for unavailable or invalid lengths.
Checksum update and padding coverage
net/src/packet/mod.rs
Packet::update_checksums limits checksum input to valid transport payload data and falls back to the full payload when needed. Tests cover padding, trailing octets, truncation, and inner VXLAN TCP packets.

Merge Risk: ⚪ Minimal · up to bb5cd

This change restores transport-checksum behavior for Ethernet padding inside VXLAN tunnels and adds properties for that behavior; no actionable merge-blocking risk remains based on the supplied evidence.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 56.52% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 23 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title identifies Ethernet padding, which is the primary scenario addressed by the checksum fix. It is concise and related to the changeset.
Description check ✅ Passed The description accurately explains the restored transport-checksum fix and the added VXLAN padding properties.
  • Fix all pre-merge checks with AI

Comment @coderabbitai help to get the list of available commands.

@daniel-noland
daniel-noland force-pushed the pr/daniel-noland/vxlan-padding branch from 56a958f to f091593 Compare September 1, 2026 19:02
@daniel-noland
daniel-noland marked this pull request as draft September 1, 2026 19:04
Base automatically changed from pr/daniel-noland/fuzz-net-headers to main September 1, 2026 19:13
@daniel-noland
daniel-noland force-pushed the pr/daniel-noland/vxlan-padding branch from f091593 to 4c19266 Compare September 1, 2026 22:43
@daniel-noland daniel-noland self-assigned this Sep 2, 2026
@daniel-noland
daniel-noland force-pushed the pr/daniel-noland/vxlan-padding branch from 4c19266 to 51d86a5 Compare September 2, 2026 01:00

@mvachhar mvachhar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix teh commit message to mention that this got undone by a rebased PR so we are just redoing it. Probably should refer to the original commits that got merged.

daniel-noland and others added 2 commits September 2, 2026 00:47
Limit transport checksums to the payload length declared by the IP header so
Ethernet padding is never treated as payload.

Restores the fix from d85bdfa, accidentally reverted by 4b91628 during a
rebase.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Daniel Noland <daniel@githedgehog.com>
Generate payloads and arbitrary trailing bytes for TCP, UDP, and a VXLAN round
trip. Build the tunnel with `Packet::vxlan_encap` so the fixture follows
production and verifies that padding never affects transport checksums.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Daniel Noland <daniel@githedgehog.com>
@daniel-noland
daniel-noland force-pushed the pr/daniel-noland/vxlan-padding branch from 51d86a5 to bb5cd4c Compare September 2, 2026 06:54
@daniel-noland
daniel-noland marked this pull request as ready for review September 2, 2026 06:55
Copilot AI lite review requested due to automatic review settings September 2, 2026 06:55
@daniel-noland daniel-noland changed the title restore the ethernet-padding checksum bound ethernet-padding Sep 2, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The checksum bounding change is localized and well-covered by new regression/property tests, with only a minor unused-import nit noted.

Pull request overview

This PR restores checksum calculation behavior by ensuring transport checksums are computed only over the IP-declared transport payload length (excluding trailing bytes such as Ethernet padding), and adds tests to lock in the expected behavior—especially for inner frames carried within VXLAN where padding is observed in practice.

Changes:

  • Bound Packet::update_checksums() to the computed transport payload length before recalculating checksums.
  • Added Headers::transport_payload_len() helper to derive the payload length from IP payload length minus extension + transport header sizes.
  • Added targeted and property-based tests covering Ethernet padding/trailing octets, including VXLAN inner frames.
File summaries
File Description
net/src/packet/mod.rs Truncates checksum input to the transport payload length and adds padding/trailing-octet regression/property tests (including VXLAN inner frames).
net/src/headers/mod.rs Introduces a helper to compute transport payload length from parsed header lengths to support bounded checksum updates.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread net/src/packet/mod.rs
@daniel-noland daniel-noland added ci:+merge-ready Run all checks which will be run in the merge queue regardless of label status ci:+test/release run release tests and removed ci:+merge-ready Run all checks which will be run in the merge queue regardless of label status labels Sep 2, 2026
@daniel-noland
daniel-noland added this pull request to the merge queue Sep 2, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Sep 2, 2026
@daniel-noland
daniel-noland added this pull request to the merge queue Sep 2, 2026
Merged via the queue into main with commit 0389e4a Sep 2, 2026
68 of 103 checks passed
@daniel-noland
daniel-noland deleted the pr/daniel-noland/vxlan-padding branch September 2, 2026 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:+test/release run release tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants