Skip to content

udp, raw: add socket allocation - #44

Merged
Dirbaio merged 2 commits into
embassy-rs:mainfrom
quartiq:raw-prepare-send
Oct 17, 2026
Merged

Dirbaio merged 2 commits into
embassy-rs:mainfrom
quartiq:raw-prepare-send

Conversation

@jordens

@jordens jordens commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

This allows users to obtain buffers with suitable headroom from the sockets.
I didn't refactor RawSocket::send_with_meta() (line 514) to make use of this new alloc() because that would have shuffled/duplicated the checks and prepare_ethernet_send() call with negative hot path performance and code size impact.
And I matched the behavior of RawSocket::send_headromm() -> 0 for an alloc() on an unbound socket.

Reserve socket headroom so callers can build packets in place.
@Dirbaio
Dirbaio added this pull request to the merge queue Oct 17, 2026
Merged via the queue into embassy-rs:main with commit 8f6f33b Oct 17, 2026
2 checks passed
@jordens
jordens deleted the raw-prepare-send branch October 17, 2026 13:20
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