Skip to content

Permit writes that don't fill the entire requested buffer in {UdpSocket, IcmpSocket}::send_to_with#5641

Merged
Dirbaio merged 5 commits intoembassy-rs:mainfrom
akeamc:udpsocket-variable-zerocopy
Mar 12, 2026
Merged

Permit writes that don't fill the entire requested buffer in {UdpSocket, IcmpSocket}::send_to_with#5641
Dirbaio merged 5 commits intoembassy-rs:mainfrom
akeamc:udpsocket-variable-zerocopy

Conversation

@akeamc
Copy link
Contributor

@akeamc akeamc commented Mar 11, 2026

This PR resolves #5636.

The send_to_with methods took a &mut self for no apparent reason (send_to doesn't and works essentially in the same way), so they have been updated to take &self instead. Or were the &mut selfs intentional? Nevermind, found the reason: smoltcp-rs/smoltcp#964 (comment) Shouldn't Udp::recv_from also take a mutable reference then?

I've tested the UDP implementation on an ESP32 with a W5500 and it appears to work!

@lulf lulf enabled auto-merge March 12, 2026 10:51
@lulf lulf added this pull request to the merge queue Mar 12, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Mar 12, 2026
@lulf lulf added this pull request to the merge queue Mar 12, 2026
@xoviat xoviat removed this pull request from the merge queue due to a manual request Mar 12, 2026
@Dirbaio Dirbaio added this pull request to the merge queue Mar 12, 2026
@Dirbaio
Copy link
Member

Dirbaio commented Mar 12, 2026

Shouldn't Udp::recv_from also take a mutable reference then?

Probably.

Merged via the queue into embassy-rs:main with commit ddc8292 Mar 12, 2026
7 checks passed
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.

embassy-net: Variable-length writes with UdpSocket::send_to_with

3 participants