summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/transport/tcp/connect.go
diff options
context:
space:
mode:
authorNayana Bidari <nybidari@google.com>2020-08-18 15:57:48 -0700
committerRahat Mahmood <46939889+mrahatm@users.noreply.github.com>2020-08-19 11:38:34 -0700
commit3e6d607ee45b817d146c6a5b791a64608c1e9d0c (patch)
treefe348e390a75a0d536b31a8ec0a52ea285de37dc /pkg/tcpip/transport/tcp/connect.go
parent79d819a62c1db623ee8cb8f7df07c2d4702fd016 (diff)
RACK: Create a new list for segments.
RACK requires the segments to be in the order of their transmission or retransmission times. This cl creates a new list and moves the retransmitted segments to the end of the list. PiperOrigin-RevId: 327325153
Diffstat (limited to 'pkg/tcpip/transport/tcp/connect.go')
-rw-r--r--pkg/tcpip/transport/tcp/connect.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/pkg/tcpip/transport/tcp/connect.go b/pkg/tcpip/transport/tcp/connect.go
index 290172ac9..87980c0a1 100644
--- a/pkg/tcpip/transport/tcp/connect.go
+++ b/pkg/tcpip/transport/tcp/connect.go
@@ -924,7 +924,18 @@ func (e *endpoint) handleWrite() *tcpip.Error {
first := e.sndQueue.Front()
if first != nil {
+ lastSeg := e.snd.writeList.Back()
e.snd.writeList.PushBackList(&e.sndQueue)
+ if lastSeg == nil {
+ lastSeg = e.snd.writeList.Front()
+ } else {
+ lastSeg = lastSeg.segEntry.Next()
+ }
+ // Add new segments to rcList, as rcList and writeList should
+ // be consistent.
+ for seg := lastSeg; seg != nil; seg = seg.segEntry.Next() {
+ e.snd.rcList.PushBack(seg)
+ }
e.sndBufInQueue = 0
}