From e147a9138326bc0e9d4e179541ffd8af41cff8a9 Mon Sep 17 00:00:00 2001 From: Joel Sing Date: Sun, 16 Dec 2018 01:29:05 +1100 Subject: [PATCH] internal/socket: use correct cmsg alignment for openbsd/arm The OpenBSD armv7 port requires 64-bit alignment for cmsgs. Change-Id: Ibb1c5dc32c9e0851d0ee23b4ebdb316d7ed79629 Reviewed-on: https://go-review.googlesource.com/c/154397 Reviewed-by: Ian Lance Taylor Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot --- internal/socket/sys_bsdvar.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/internal/socket/sys_bsdvar.go b/internal/socket/sys_bsdvar.go index f723fa36a..164ddfce8 100644 --- a/internal/socket/sys_bsdvar.go +++ b/internal/socket/sys_bsdvar.go @@ -6,9 +6,15 @@ package socket -import "unsafe" +import ( + "runtime" + "unsafe" +) func probeProtocolStack() int { + if runtime.GOOS == "openbsd" && runtime.GOARCH == "arm" { + return 8 + } var p uintptr return int(unsafe.Sizeof(p)) }