Commit 3949450f authored by Ondřej Surý's avatar Ondřej Surý

Merge branch '521-align-cmsg-buffers' into 'master'

Resolve "BIND 9.11.4 terminates with SIGBUS error when compiled with Oracle Developer Studio 12.6"

Closes #521

See merge request isc-projects/bind9!758
parents a985badd 17212cf9
Pipeline #4710 passed with stages
in 9 minutes and 21 seconds
5030. [bug] Align CMSG buffers to a 64-bit boundary, fixes crash
on architectures with strict alignment. [GL #521]
--- 9.13.3 released ---
5029. [func] Workarounds for servers that misbehave when queried
......
......@@ -259,6 +259,11 @@ extern void mock_assert(const int result, const char* const expression,
*/
#define TIME_NOW(tp) RUNTIME_CHECK(isc_time_now((tp)) == ISC_R_SUCCESS)
/*%
* Alignment
*/
#define ALIGN(x, a) (((x) + (a) - 1) & ~((typeof(x))(a)-1))
/*%
* Misc
*/
......
......@@ -315,8 +315,9 @@ typedef isc_event_t intev_t;
#define CMSG_SP_INT 24
#define RECVCMSGBUFLEN (2*(CMSG_SP_IN6PKT + CMSG_SP_TIMESTAMP + CMSG_SP_TCTOS)+1)
#define SENDCMSGBUFLEN (2*(CMSG_SP_IN6PKT + CMSG_SP_INT + CMSG_SP_TCTOS)+1)
/* Align cmsg buffers to be safe on SPARC etc. */
#define RECVCMSGBUFLEN ALIGN(2*(CMSG_SP_IN6PKT + CMSG_SP_TIMESTAMP + CMSG_SP_TCTOS)+1, sizeof(void*))
#define SENDCMSGBUFLEN ALIGN(2*(CMSG_SP_IN6PKT + CMSG_SP_INT + CMSG_SP_TCTOS)+1, sizeof(void*))
/*%
* The number of times a send operation is repeated if the result is EINTR.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment