summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/transport/icmp
diff options
context:
space:
mode:
authorTamir Duberstein <tamird@google.com>2019-05-24 12:28:15 -0700
committerShentubot <shentubot@google.com>2019-05-24 12:29:14 -0700
commite4b395db49e9e90659bd3d366f62aa258a3c7157 (patch)
treecd5dc7688d066671f0323ab47951999e21c62839 /pkg/tcpip/transport/icmp
parenta949133c4b22a87c79310b2d825f2899028d6088 (diff)
Remove unused wakers
These wakers are uselessly allocated and passed around; nothing ever listens for notifications on them. The code here appears to be vestigial, so removing it and allowing a nil waker to be passed seems appropriate. PiperOrigin-RevId: 249879320 Change-Id: Icd209fb77cc0dd4e5c49d7a9f2adc32bf88b4b71
Diffstat (limited to 'pkg/tcpip/transport/icmp')
-rw-r--r--pkg/tcpip/transport/icmp/endpoint.go8
1 files changed, 1 insertions, 7 deletions
diff --git a/pkg/tcpip/transport/icmp/endpoint.go b/pkg/tcpip/transport/icmp/endpoint.go
index cc384dd3d..e2b90ef10 100644
--- a/pkg/tcpip/transport/icmp/endpoint.go
+++ b/pkg/tcpip/transport/icmp/endpoint.go
@@ -18,7 +18,6 @@ import (
"encoding/binary"
"sync"
- "gvisor.googlesource.com/gvisor/pkg/sleep"
"gvisor.googlesource.com/gvisor/pkg/tcpip"
"gvisor.googlesource.com/gvisor/pkg/tcpip/buffer"
"gvisor.googlesource.com/gvisor/pkg/tcpip/header"
@@ -274,13 +273,8 @@ func (e *endpoint) Write(p tcpip.Payload, opts tcpip.WriteOptions) (uintptr, <-c
}
if route.IsResolutionRequired() {
- waker := &sleep.Waker{}
- if ch, err := route.Resolve(waker); err != nil {
+ if ch, err := route.Resolve(nil); err != nil {
if err == tcpip.ErrWouldBlock {
- // Link address needs to be resolved.
- // Resolution was triggered the background.
- // Better luck next time.
- route.RemoveWaker(waker)
return 0, ch, tcpip.ErrNoLinkAddress
}
return 0, nil, err