diff --git a/cmd/derper/depaware.txt b/cmd/derper/depaware.txt index 4de2f682d..492269c87 100644 --- a/cmd/derper/depaware.txt +++ b/cmd/derper/depaware.txt @@ -64,7 +64,6 @@ tailscale.com/cmd/derper dependencies: (generated by github.com/tailscale/depawa tailscale.com/types/logger from tailscale.com/cmd/derper+ tailscale.com/types/netmap from tailscale.com/ipn tailscale.com/types/opt from tailscale.com/client/tailscale+ - tailscale.com/types/pad32 from tailscale.com/derp tailscale.com/types/persist from tailscale.com/ipn tailscale.com/types/preftype from tailscale.com/ipn tailscale.com/types/structs from tailscale.com/ipn+ diff --git a/cmd/tailscale/depaware.txt b/cmd/tailscale/depaware.txt index 63012be74..c43ce78e9 100644 --- a/cmd/tailscale/depaware.txt +++ b/cmd/tailscale/depaware.txt @@ -87,7 +87,6 @@ tailscale.com/cmd/tailscale dependencies: (generated by github.com/tailscale/dep tailscale.com/types/netmap from tailscale.com/ipn tailscale.com/types/nettype from tailscale.com/net/netcheck+ 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 58032b196..3ee8ba01b 100644 --- a/cmd/tailscaled/depaware.txt +++ b/cmd/tailscaled/depaware.txt @@ -266,7 +266,6 @@ 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 c7f13aad6..32cba4d4b 100644 --- a/derp/derp_server.go +++ b/derp/derp_server.go @@ -42,7 +42,6 @@ import ( "tailscale.com/metrics" "tailscale.com/types/key" "tailscale.com/types/logger" - "tailscale.com/types/pad32" "tailscale.com/version" ) @@ -89,6 +88,8 @@ const ( disableFighters ) +type align64 [0]atomic.Int64 // for side effect of its 64-bit alignment + // Server is a DERP server. type Server struct { // WriteTimeout, if non-zero, specifies how long to wait @@ -111,14 +112,14 @@ type Server struct { packetsRecvByKind metrics.LabelMap packetsRecvDisco *expvar.Int packetsRecvOther *expvar.Int - _ pad32.Four + _ align64 packetsDropped expvar.Int packetsDroppedReason metrics.LabelMap packetsDroppedReasonCounters []*expvar.Int // indexed by dropReason packetsDroppedType metrics.LabelMap packetsDroppedTypeDisco *expvar.Int packetsDroppedTypeOther *expvar.Int - _ pad32.Four + _ align64 packetsForwardedOut expvar.Int packetsForwardedIn expvar.Int peerGoneFrames expvar.Int // number of peer gone frames sent diff --git a/net/tstun/wrap.go b/net/tstun/wrap.go index ebb09ed6e..a447e0ce6 100644 --- a/net/tstun/wrap.go +++ b/net/tstun/wrap.go @@ -82,7 +82,7 @@ type Wrapper struct { // lastActivityAtomic is read/written atomically. // On 32 bit systems, if the fields above change, - // you might need to add a pad32.Four field here. + // you might need to add an align64 field here. lastActivityAtomic mono.Time // time of last send or receive destIPActivity syncs.AtomicValue[map[netip.Addr]func()] diff --git a/types/pad32/pad32.go b/types/pad32/pad32.go deleted file mode 100644 index 4db116623..000000000 --- a/types/pad32/pad32.go +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) 2021 Tailscale Inc & AUTHORS All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package pad32 defines padding types that have width on only 32-bit platforms. -package pad32 - -// Four is 4 bytes of padding on 32-bit machines, else 0 bytes. -type Four [4 * (1 - ((^uint(0))>>32)&1)]byte