summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/sample/tun_tcp_echo
diff options
context:
space:
mode:
authorTamir Duberstein <tamird@google.com>2021-01-28 17:57:42 -0800
committergVisor bot <gvisor-bot@google.com>2021-01-28 17:59:58 -0800
commit8d1afb4185789cce7a90e7dc365e4a7afda9a8fc (patch)
tree555164dca377cf17ea10b0411deaca8aaf1f09b6 /pkg/tcpip/sample/tun_tcp_echo
parentc99e092a3bb986b03fd85d426e166ef2c73a8c51 (diff)
Change tcpip.Error to an interface
This makes it possible to add data to types that implement tcpip.Error. ErrBadLinkEndpoint is removed as it is unused. PiperOrigin-RevId: 354437314
Diffstat (limited to 'pkg/tcpip/sample/tun_tcp_echo')
-rw-r--r--pkg/tcpip/sample/tun_tcp_echo/main.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/pkg/tcpip/sample/tun_tcp_echo/main.go b/pkg/tcpip/sample/tun_tcp_echo/main.go
index ae9cf44e7..9b23df3a9 100644
--- a/pkg/tcpip/sample/tun_tcp_echo/main.go
+++ b/pkg/tcpip/sample/tun_tcp_echo/main.go
@@ -51,7 +51,7 @@ type endpointWriter struct {
}
type tcpipError struct {
- inner *tcpip.Error
+ inner tcpip.Error
}
func (e *tcpipError) Error() string {
@@ -89,7 +89,7 @@ func echo(wq *waiter.Queue, ep tcpip.Endpoint) {
for {
_, err := ep.Read(&w, tcpip.ReadOptions{})
if err != nil {
- if err == tcpip.ErrWouldBlock {
+ if _, ok := err.(*tcpip.ErrWouldBlock); ok {
<-notifyCh
continue
}
@@ -217,7 +217,7 @@ func main() {
for {
n, wq, err := ep.Accept(nil)
if err != nil {
- if err == tcpip.ErrWouldBlock {
+ if _, ok := err.(*tcpip.ErrWouldBlock); ok {
<-notifyCh
continue
}