summaryrefslogtreecommitdiffstats
path: root/vendor/golang.org/x/sys/unix/sockcmsg_unix.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2019-01-31 17:06:36 +0100
committerWim <wim@42.be>2019-01-31 17:06:36 +0100
commitc81c0dd22a7779148c4890cfd4bbf490054f06f1 (patch)
tree06ce6fcdc8f3a2278a2f3050ba42088dd2e64485 /vendor/golang.org/x/sys/unix/sockcmsg_unix.go
parentf8a1ab4622a5b833282e9ee42f382451d17c1a06 (diff)
downloadmatterbridge-msglm-c81c0dd22a7779148c4890cfd4bbf490054f06f1.tar.gz
matterbridge-msglm-c81c0dd22a7779148c4890cfd4bbf490054f06f1.tar.bz2
matterbridge-msglm-c81c0dd22a7779148c4890cfd4bbf490054f06f1.zip
Update vendor, move to labstack/echo/v4 Fixes #698
Diffstat (limited to 'vendor/golang.org/x/sys/unix/sockcmsg_unix.go')
-rw-r--r--vendor/golang.org/x/sys/unix/sockcmsg_unix.go25
1 files changed, 19 insertions, 6 deletions
diff --git a/vendor/golang.org/x/sys/unix/sockcmsg_unix.go b/vendor/golang.org/x/sys/unix/sockcmsg_unix.go
index 9dd2f32f..5f9ae233 100644
--- a/vendor/golang.org/x/sys/unix/sockcmsg_unix.go
+++ b/vendor/golang.org/x/sys/unix/sockcmsg_unix.go
@@ -8,17 +8,30 @@
package unix
-import "unsafe"
+import (
+ "runtime"
+ "unsafe"
+)
// Round the length of a raw sockaddr up to align it properly.
func cmsgAlignOf(salen int) int {
salign := SizeofPtr
- // NOTE: It seems like 64-bit Darwin, DragonFly BSD and
- // Solaris kernels still require 32-bit aligned access to
- // network subsystem.
- if darwin64Bit || dragonfly64Bit || solaris64Bit {
- salign = 4
+
+ switch runtime.GOOS {
+ case "darwin", "dragonfly", "solaris":
+ // NOTE: It seems like 64-bit Darwin, DragonFly BSD and
+ // Solaris kernels still require 32-bit aligned access to
+ // network subsystem.
+ if SizeofPtr == 8 {
+ salign = 4
+ }
+ case "openbsd":
+ // OpenBSD armv7 requires 64-bit alignment.
+ if runtime.GOARCH == "arm" {
+ salign = 8
+ }
}
+
return (salen + salign - 1) & ^(salign - 1)
}