Skip to content

Remove hdr_raw usage#134

Merged
jamesmunns merged 9 commits intomainfrom
james/fix-raw-hdr
Sep 9, 2025
Merged

Remove hdr_raw usage#134
jamesmunns merged 9 commits intomainfrom
james/fix-raw-hdr

Conversation

@jamesmunns
Copy link
Copy Markdown
Owner

@jamesmunns jamesmunns commented Sep 8, 2025

A retooling of how we use headers in send_raw operations. Major changes:

  • NetStack::send_raw now takes HeaderSeq instead of Header
  • NetStack::send_raw no longer takes hdr_raw, as well as many other parts of the system
  • Reduce usage of CommonHeader and AnyAllAppendix, instead using HeaderSeq more consistently
  • Headers are now generally re-serialized down at the InterfaceSink level, so they don't need to be re-encoded more than once.

Originally, the idea behind passing around hdr_raw was to avoid cases where profiles/interfaces or borrowed sockets would need to re-serialize the header when forwarding. However, there are places in the code where the header may be modified, particularly for broadcast flooding, or even for updating the TTL count when forwarding, meaning that the serialized and in-memory versions could get out of sync with each other.

To avoid this, we no longer pass around the "raw" header, and just demand it is re-serialized when necessary. This is actually likely not very burdensome at all, as the max header size is 28 bytes, which should be trivial to do.

@jamesmunns jamesmunns changed the title WIP: Fix raw header usage in send_raw Remove hdr_raw usage Sep 9, 2025
@jamesmunns jamesmunns merged commit b23f99e into main Sep 9, 2025
7 checks passed
@jamesmunns jamesmunns deleted the james/fix-raw-hdr branch September 9, 2025 16:28
jamesmunns added a commit that referenced this pull request Sep 9, 2025
jamesmunns added a commit that referenced this pull request Sep 9, 2025
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.

1 participant