diff options
author | gVisor bot <gvisor-bot@google.com> | 2021-05-12 01:11:17 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-05-12 01:11:17 +0000 |
commit | a8920885e3c9a185f6e686451aec9be18b9d06e4 (patch) | |
tree | 6115ca3be9187ef39a8bebbe208f3660381eacfe /pkg/tcpip/stack/stack.go | |
parent | ccc377e3a485ddda506be9ff0149bb936f954816 (diff) | |
parent | 8f6bfe257e162c14faa25ee00dc249859994c2c8 (diff) |
Merge release-20210503.0-45-g8f6bfe257 (automated)
Diffstat (limited to 'pkg/tcpip/stack/stack.go')
-rw-r--r-- | pkg/tcpip/stack/stack.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/pkg/tcpip/stack/stack.go b/pkg/tcpip/stack/stack.go index 436392f23..3d9e1e286 100644 --- a/pkg/tcpip/stack/stack.go +++ b/pkg/tcpip/stack/stack.go @@ -29,6 +29,7 @@ import ( "time" "golang.org/x/time/rate" + "gvisor.dev/gvisor/pkg/atomicbitops" "gvisor.dev/gvisor/pkg/rand" "gvisor.dev/gvisor/pkg/sync" "gvisor.dev/gvisor/pkg/tcpip" @@ -65,10 +66,10 @@ type ResumableEndpoint interface { } // uniqueIDGenerator is a default unique ID generator. -type uniqueIDGenerator uint64 +type uniqueIDGenerator atomicbitops.AlignedAtomicUint64 func (u *uniqueIDGenerator) UniqueID() uint64 { - return atomic.AddUint64((*uint64)(u), 1) + return ((*atomicbitops.AlignedAtomicUint64)(u)).Add(1) } // Stack is a networking stack, with all supported protocols, NICs, and route |