Skip to content

Commit 1b9ac3e

Browse files
committed
Fix misaligned references when using recvmsg with control messages
On some platforms the alignment of cmsg_data could be less than the alignment of the messages that it contains. That led to unaligned reads on those platforms. This change fixes the issue by always copying the message contents into aligned objects. The change is not 100% backwards compatible when using recvmsg. Users may have to replace code like this: ```rust if let ControlMessage::ScmRights(&fds) = cmsg { ``` with this: ```rust if let ControlMessageOwned::ScmRights(fds) = cmsg { ``` Fixes #999
1 parent 9f69c7d commit 1b9ac3e

File tree

3 files changed

+179
-289
lines changed

3 files changed

+179
-289
lines changed

0 commit comments

Comments
 (0)