summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/transport/tcp/cubic.go
diff options
context:
space:
mode:
authorTamir Duberstein <tamird@google.com>2018-09-04 12:38:31 -0700
committerShentubot <shentubot@google.com>2018-09-04 12:39:47 -0700
commit3794cb6bff094820d78bc3199dc6910af3d194c0 (patch)
tree0a411818ffc54bc18250917b3a22131abe7aa9f0 /pkg/tcpip/transport/tcp/cubic.go
parentc09f9acd7c7a2e85472b1ee47bf26f7c89ded43e (diff)
Expose TCP RTT
PiperOrigin-RevId: 211504634 Change-Id: I9a7bcbbdd40e5036894930f709278725ef477293
Diffstat (limited to 'pkg/tcpip/transport/tcp/cubic.go')
-rw-r--r--pkg/tcpip/transport/tcp/cubic.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/pkg/tcpip/transport/tcp/cubic.go b/pkg/tcpip/transport/tcp/cubic.go
index cdb85598d..8cea416d2 100644
--- a/pkg/tcpip/transport/tcp/cubic.go
+++ b/pkg/tcpip/transport/tcp/cubic.go
@@ -129,7 +129,10 @@ func (c *cubicState) Update(packetsAcked int) {
return
}
} else {
- c.s.sndCwnd = c.getCwnd(packetsAcked, c.s.sndCwnd, c.s.srtt)
+ c.s.rtt.Lock()
+ srtt := c.s.rtt.srtt
+ c.s.rtt.Unlock()
+ c.s.sndCwnd = c.getCwnd(packetsAcked, c.s.sndCwnd, srtt)
}
}