From: Tobias Klauser Date: Thu, 1 Oct 2020 08:25:20 +0000 (+0200) Subject: syscall: use correct cmsg alignment for netbsd/arm64 X-Git-Tag: go1.16beta1~881 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=069aef4067480ab29f5788b31171054954577661;p=gostls13.git syscall: use correct cmsg alignment for netbsd/arm64 netbsd/arm64 requires 128-bit alignment for cmsgs. Re-submit of CL 258437 which was dropped due to #41718. Change-Id: I898043d79f513bebe1a5eb931e7ebd8e291a5aec Reviewed-on: https://go-review.googlesource.com/c/go/+/258677 Trust: Tobias Klauser Trust: Benny Siegert Run-TryBot: Tobias Klauser TryBot-Result: Go Bot Reviewed-by: Benny Siegert --- diff --git a/src/syscall/sockcmsg_unix_other.go b/src/syscall/sockcmsg_unix_other.go index 3aaf7c3616..40f03142a6 100644 --- a/src/syscall/sockcmsg_unix_other.go +++ b/src/syscall/sockcmsg_unix_other.go @@ -32,6 +32,10 @@ func cmsgAlignOf(salen int) int { if runtime.GOARCH == "arm" { salign = 8 } + // NetBSD aarch64 requires 128-bit alignment. + if runtime.GOOS == "netbsd" && runtime.GOARCH == "arm64" { + salign = 16 + } } return (salen + salign - 1) & ^(salign - 1)