summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/transport/ping
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/tcpip/transport/ping')
-rw-r--r--pkg/tcpip/transport/ping/endpoint.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/pkg/tcpip/transport/ping/endpoint.go b/pkg/tcpip/transport/ping/endpoint.go
index b3f54cfe0..10d4d138e 100644
--- a/pkg/tcpip/transport/ping/endpoint.go
+++ b/pkg/tcpip/transport/ping/endpoint.go
@@ -299,7 +299,11 @@ func (e *endpoint) Write(p tcpip.Payload, opts tcpip.WriteOptions) (uintptr, <-c
err = sendPing6(route, e.id.LocalPort, v)
}
- return uintptr(len(v)), nil, err
+ if err != nil {
+ return 0, nil, err
+ }
+
+ return uintptr(len(v)), nil, nil
}
// Peek only returns data from a single datagram, so do nothing here.