summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorBhasker Hariharan <bhaskerh@google.com>2020-01-10 06:01:10 -0800
committergVisor bot <gvisor-bot@google.com>2020-01-10 06:03:02 -0800
commitdacd349d6fb4fc7453b1fbf694158fd25496ed42 (patch)
tree9289233e6c6faebf3ef62037c473c4e7685f8caf
parent27500d529f7fb87eef8812278fd1bbca67bcba72 (diff)
panic fix in retransmitTimerExpired.
This is a band-aid fix for now to prevent panics. PiperOrigin-RevId: 289078453
-rw-r--r--pkg/tcpip/transport/tcp/snd.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/pkg/tcpip/transport/tcp/snd.go b/pkg/tcpip/transport/tcp/snd.go
index 79f2d274b..fdff7ed81 100644
--- a/pkg/tcpip/transport/tcp/snd.go
+++ b/pkg/tcpip/transport/tcp/snd.go
@@ -442,6 +442,13 @@ func (s *sender) retransmitTimerExpired() bool {
return true
}
+ // TODO(b/147297758): Band-aid fix, retransmitTimer can fire in some edge cases
+ // when writeList is empty. Remove this once we have a proper fix for this
+ // issue.
+ if s.writeList.Front() == nil {
+ return true
+ }
+
s.ep.stack.Stats().TCP.Timeouts.Increment()
s.ep.stats.SendErrors.Timeouts.Increment()