Skip to content

Commit

Permalink
internal/socket: use correct cmsg alignment for openbsd/arm
Browse files Browse the repository at this point in the history
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 <[email protected]>
Run-TryBot: Ian Lance Taylor <[email protected]>
TryBot-Result: Gobot Gobot <[email protected]>
  • Loading branch information
4a6f656c authored and bradfitz committed Dec 17, 2018
1 parent 891ebc4 commit e147a91
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion internal/socket/sys_bsdvar.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}

0 comments on commit e147a91

Please sign in to comment.