From 069aef4067480ab29f5788b31171054954577661 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Thu, 1 Oct 2020 10:25:20 +0200 Subject: [PATCH] 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 --- src/syscall/sockcmsg_unix_other.go | 4 ++++ 1 file changed, 4 insertions(+) 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) -- 2.48.1