summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/transport/udp
diff options
context:
space:
mode:
authorIan Gudger <igudger@google.com>2018-07-09 21:19:58 -0700
committerShentubot <shentubot@google.com>2018-07-09 21:20:50 -0700
commitafd655a5d8b9d9bc747ee99b1ec2475cc526c996 (patch)
tree4ca24c04f19c85a6b24fb89ef57d4e0c26fde026 /pkg/tcpip/transport/udp
parentda9b5153f2fafab1597b34336f8a95c1b861f0ac (diff)
Notify UDP and Ping endpoints on close
PiperOrigin-RevId: 203883138 Change-Id: I7500c0a70f5d71c3fb37e2477f7fc466fa92fd3e
Diffstat (limited to 'pkg/tcpip/transport/udp')
-rw-r--r--pkg/tcpip/transport/udp/endpoint.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/pkg/tcpip/transport/udp/endpoint.go b/pkg/tcpip/transport/udp/endpoint.go
index eb2f26189..2a32c3a87 100644
--- a/pkg/tcpip/transport/udp/endpoint.go
+++ b/pkg/tcpip/transport/udp/endpoint.go
@@ -121,7 +121,6 @@ func NewConnectedEndpoint(stack *stack.Stack, r *stack.Route, id stack.Transport
// associated with it.
func (e *endpoint) Close() {
e.mu.Lock()
- defer e.mu.Unlock()
switch e.state {
case stateBound, stateConnected:
@@ -142,6 +141,10 @@ func (e *endpoint) Close() {
// Update the state.
e.state = stateClosed
+
+ e.mu.Unlock()
+
+ e.waiterQueue.Notify(waiter.EventHUp | waiter.EventErr | waiter.EventIn | waiter.EventOut)
}
// Read reads data from the endpoint. This method does not block if