aboutsummaryrefslogtreecommitdiff
path: root/src/syscall
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2020-10-01 10:25:20 +0200
committerTobias Klauser <tobias.klauser@gmail.com>2020-10-01 13:23:43 +0000
commit069aef4067480ab29f5788b31171054954577661 (patch)
tree508ccbeb2de8edaf2e9c140d643df917751575d6 /src/syscall
parent9b1518aeda297f87d6d06218ddb744c71fefb80d (diff)
downloadgo-069aef4067480ab29f5788b31171054954577661.tar.gz
go-069aef4067480ab29f5788b31171054954577661.zip
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 <tobias.klauser@gmail.com> Trust: Benny Siegert <bsiegert@gmail.com> Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Benny Siegert <bsiegert@gmail.com>
Diffstat (limited to 'src/syscall')
-rw-r--r--src/syscall/sockcmsg_unix_other.go4
1 files changed, 4 insertions, 0 deletions
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)