Skip to content

Don't use a shared reference in MsgHdrMut - #674

Open
Thomasdezeeuw wants to merge 2 commits into
masterfrom
thomas/673
Open

Thomasdezeeuw wants to merge 2 commits into
masterfrom
thomas/673

Conversation

@Thomasdezeeuw

Copy link
Copy Markdown
Collaborator

Because we used set_msghdr_name, which uses a reference to SockAddr we
broke the aliasing rules. See #673 for more details. To fix this use raw pointers instead.

Also adds SockAddr::as_mut_ptr, which I needed to do this and since it's quite useful I made it public.

Fixes #673

Returns a raw mutable pointer to the address.
Because we used set_msghdr_name, which uses a reference to SockAddr we
broke the aliasing rules. See #673 for more details.

To fix this use raw pointers instead.

Fixes #673

This branch has not been deployed

No deployments
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.

MsgHdrMut::with_addr derives msg_name from a shared reborrow, so recvmsg writes through SharedReadOnly provenance

1 participant