summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2020-09-29 06:34:47 +0000
committergVisor bot <gvisor-bot@google.com>2020-09-29 06:34:47 +0000
commitc56633d8504615721910f62b9fd236ce4a6a8ee7 (patch)
treefca79af6281288732e524c150fed84e6de39a09f /pkg/tcpip
parentd99063318481128c2151cd1901bff5b4aa684c3e (diff)
parent028e045da93b7c1c26417e80e4b4e388b86a713d (diff)
Merge release-20200921.0-59-g028e045da (automated)
Diffstat (limited to 'pkg/tcpip')
-rw-r--r--pkg/tcpip/transport/tcp/rcv.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/pkg/tcpip/transport/tcp/rcv.go b/pkg/tcpip/transport/tcp/rcv.go
index 4aafb4d22..48bf196d8 100644
--- a/pkg/tcpip/transport/tcp/rcv.go
+++ b/pkg/tcpip/transport/tcp/rcv.go
@@ -88,6 +88,13 @@ func (r *receiver) acceptable(segSeq seqnum.Value, segLen seqnum.Size) bool {
// segments to send.
func (r *receiver) getSendParams() (rcvNxt seqnum.Value, rcvWnd seqnum.Size) {
avail := wndFromSpace(r.ep.receiveBufferAvailable())
+ if avail == 0 {
+ // We have no space available to accept any data, move to zero window
+ // state.
+ r.rcvWnd = 0
+ return r.rcvNxt, 0
+ }
+
acc := r.rcvNxt.Add(seqnum.Size(avail))
newWnd := r.rcvNxt.Size(acc)
curWnd := r.rcvNxt.Size(r.rcvAcc)