summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--pkg/tcpip/transport/tcp/endpoint.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/pkg/tcpip/transport/tcp/endpoint.go b/pkg/tcpip/transport/tcp/endpoint.go
index 8c5be0586..83ec99fa9 100644
--- a/pkg/tcpip/transport/tcp/endpoint.go
+++ b/pkg/tcpip/transport/tcp/endpoint.go
@@ -1586,7 +1586,9 @@ func (e *endpoint) Write(p tcpip.Payloader, opts tcpip.WriteOptions) (int64, tcp
return e.drainSendQueueLocked(), len(v), nil
}()
- if err != nil {
+ // Return if either we didn't queue anything or if an error occurred while
+ // attempting to queue data.
+ if n == 0 || err != nil {
return 0, err
}
e.sendData(nextSeg)