diff options
author | gVisor bot <gvisor-bot@google.com> | 2021-02-09 04:18:27 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-02-09 04:18:27 +0000 |
commit | ccf8cbfe805fefb8a8f549a9c9ecb65c66631b29 (patch) | |
tree | a7ca111e7224c7631bd03dfb693e9404b4a80b0a /pkg/tcpip/transport | |
parent | b64a1b5924ffd24dd70175529b36bd3674d07efd (diff) | |
parent | 95500ece56f2acf34fcdc74e420f91beea888ada (diff) |
Merge release-20210201.0-60-g95500ece5 (automated)
Diffstat (limited to 'pkg/tcpip/transport')
-rw-r--r-- | pkg/tcpip/transport/udp/endpoint.go | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/pkg/tcpip/transport/udp/endpoint.go b/pkg/tcpip/transport/udp/endpoint.go index afd8f4d39..807df2bb5 100644 --- a/pkg/tcpip/transport/udp/endpoint.go +++ b/pkg/tcpip/transport/udp/endpoint.go @@ -938,11 +938,6 @@ func (e *endpoint) Disconnect() tcpip.Error { // Connect connects the endpoint to its peer. Specifying a NIC is optional. func (e *endpoint) Connect(addr tcpip.FullAddress) tcpip.Error { - if addr.Port == 0 { - // We don't support connecting to port zero. - return &tcpip.ErrInvalidEndpointState{} - } - e.mu.Lock() defer e.mu.Unlock() @@ -1188,7 +1183,7 @@ func (e *endpoint) GetRemoteAddress() (tcpip.FullAddress, tcpip.Error) { e.mu.RLock() defer e.mu.RUnlock() - if e.EndpointState() != StateConnected { + if e.EndpointState() != StateConnected || e.dstPort == 0 { return tcpip.FullAddress{}, &tcpip.ErrNotConnected{} } |