diff --git a/cmd/tailscale/depaware.txt b/cmd/tailscale/depaware.txt index 77f5e16b0..76722d2fd 100644 --- a/cmd/tailscale/depaware.txt +++ b/cmd/tailscale/depaware.txt @@ -57,6 +57,7 @@ tailscale.com/cmd/tailscale dependencies: (generated by github.com/tailscale/dep tailscale.com/types/logger from tailscale.com/cmd/tailscale/cli+ tailscale.com/types/netmap from tailscale.com/ipn tailscale.com/types/opt from tailscale.com/net/netcheck+ + tailscale.com/types/pad32 from tailscale.com/derp tailscale.com/types/persist from tailscale.com/ipn tailscale.com/types/preftype from tailscale.com/cmd/tailscale/cli+ tailscale.com/types/structs from tailscale.com/ipn+ diff --git a/cmd/tailscaled/depaware.txt b/cmd/tailscaled/depaware.txt index 5c0e19ed6..98547c100 100644 --- a/cmd/tailscaled/depaware.txt +++ b/cmd/tailscaled/depaware.txt @@ -140,6 +140,7 @@ tailscale.com/cmd/tailscaled dependencies: (generated by github.com/tailscale/de tailscale.com/types/netmap from tailscale.com/control/controlclient+ tailscale.com/types/nettype from tailscale.com/wgengine/magicsock tailscale.com/types/opt from tailscale.com/control/controlclient+ + tailscale.com/types/pad32 from tailscale.com/derp tailscale.com/types/persist from tailscale.com/control/controlclient+ tailscale.com/types/preftype from tailscale.com/ipn+ tailscale.com/types/structs from tailscale.com/control/controlclient+ diff --git a/derp/derp_server.go b/derp/derp_server.go index 995706aab..f85f195a4 100644 --- a/derp/derp_server.go +++ b/derp/derp_server.go @@ -43,6 +43,7 @@ import ( "tailscale.com/metrics" "tailscale.com/types/key" "tailscale.com/types/logger" + "tailscale.com/types/pad32" "tailscale.com/version" ) @@ -76,13 +77,6 @@ const ( writeTimeout = 2 * time.Second ) -const host64bit = (^uint(0) >> 32) & 1 // 1 on 64-bit, 0 on 32-bit - -// pad32bit is 4 on 32-bit machines and 0 on 64-bit. -// It exists so the Server struct's atomic fields can be aligned to 8 -// byte boundaries. (As tested by GOARCH=386 go test, etc) -const pad32bit = 4 - host64bit*4 // 0 on 64-bit, 4 on 32-bit - // Server is a DERP server. type Server struct { // WriteTimeout, if non-zero, specifies how long to wait @@ -98,20 +92,20 @@ type Server struct { metaCert []byte // the encoded x509 cert to send after LetsEncrypt cert+intermediate // Counters: - _ [pad32bit]byte + _ pad32.Four packetsSent, bytesSent expvar.Int packetsRecv, bytesRecv expvar.Int packetsRecvByKind metrics.LabelMap packetsRecvDisco *expvar.Int packetsRecvOther *expvar.Int - _ [pad32bit]byte + _ pad32.Four packetsDropped expvar.Int packetsDroppedReason metrics.LabelMap packetsDroppedReasonCounters []*expvar.Int // indexed by dropReason packetsDroppedType metrics.LabelMap packetsDroppedTypeDisco *expvar.Int packetsDroppedTypeOther *expvar.Int - _ [pad32bit]byte + _ pad32.Four packetsForwardedOut expvar.Int packetsForwardedIn expvar.Int peerGoneFrames expvar.Int // number of peer gone frames sent