]> git.ipfire.org Git - thirdparty/unbound.git/commit
Ensure proper alignment of cmsg buffers 234/head
authorJeremie Courreges-Anglas <jca@wxcvbn.org>
Sun, 10 May 2020 14:46:48 +0000 (16:46 +0200)
committerJeremie Courreges-Anglas <jca@wxcvbn.org>
Sun, 10 May 2020 15:23:33 +0000 (17:23 +0200)
commit8175161059dadce2a3370bf29bef9cfb40f5e4fe
treec8649977ab6c9c4d24b0153637165e505d1fda26
parenta269db3828a107fbf7601567268b41800999e427
Ensure proper alignment of cmsg buffers

The cmsg macros expect a control message buffer to be aligned like
a struct cmsghdr.  The current layout around those stack-allocated
buffers probably provides the required alignment (usually 4 bytes).
Use a union to enforce proper alignment, in case future changes modify
the stack layout.

Spotted when chasing an unrelated bug with Otto Moerbeek (@omoerbeek).
util/netevent.c