summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/transport/tcp/connect.go
diff options
context:
space:
mode:
authorIan Gudger <igudger@google.com>2018-08-23 08:54:09 -0700
committerShentubot <shentubot@google.com>2018-08-23 08:55:23 -0700
commitabe7764928bb18fe417c53c8ea8aa9fb970114b7 (patch)
tree4ea44a38b3193ac29a4151daff471d8744f9071e /pkg/tcpip/transport/tcp/connect.go
parenta78df1d874f376c0924d5a8f91e9e2b5458cca0f (diff)
Encapsulate netstack metrics
PiperOrigin-RevId: 209943212 Change-Id: I96dcbc7c2ab2426e510b94a564436505256c5c79
Diffstat (limited to 'pkg/tcpip/transport/tcp/connect.go')
-rw-r--r--pkg/tcpip/transport/tcp/connect.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/pkg/tcpip/transport/tcp/connect.go b/pkg/tcpip/transport/tcp/connect.go
index b90d3fe48..58d7942f3 100644
--- a/pkg/tcpip/transport/tcp/connect.go
+++ b/pkg/tcpip/transport/tcp/connect.go
@@ -16,7 +16,6 @@ package tcp
import (
"sync"
- "sync/atomic"
"time"
"gvisor.googlesource.com/gvisor/pkg/rand"
@@ -292,7 +291,7 @@ func (h *handshake) synRcvdState(s *segment) *tcpip.Error {
// not carry a timestamp option then the segment must be dropped
// as per https://tools.ietf.org/html/rfc7323#section-3.2.
if h.ep.sendTSOk && !s.parsedOptions.TS {
- atomic.AddUint64(&h.ep.stack.MutableStats().DroppedPackets, 1)
+ h.ep.stack.Stats().DroppedPackets.Increment()
return nil
}
@@ -793,7 +792,7 @@ func (e *endpoint) handleSegments() *tcpip.Error {
// must be dropped as per
// https://tools.ietf.org/html/rfc7323#section-3.2.
if e.sendTSOk && !s.parsedOptions.TS {
- atomic.AddUint64(&e.stack.MutableStats().DroppedPackets, 1)
+ e.stack.Stats().DroppedPackets.Increment()
s.decRef()
continue
}