diff options
author | Andrei Vagin <avagin@google.com> | 2019-07-03 13:57:24 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2019-07-03 14:19:02 -0700 |
commit | 116cac053e2e4e167caa9707439065af7c7b82b3 (patch) | |
tree | 1cc098420d1f323f1e8d92dfba3ed4a4c7991cfe /pkg/tcpip/transport/raw | |
parent | f10862696c8508ee69f25838e25caacabf55ef83 (diff) |
netstack/udp: connect with the AF_UNSPEC address family means disconnect
PiperOrigin-RevId: 256433283
Diffstat (limited to 'pkg/tcpip/transport/raw')
-rw-r--r-- | pkg/tcpip/transport/raw/endpoint.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/pkg/tcpip/transport/raw/endpoint.go b/pkg/tcpip/transport/raw/endpoint.go index 73599dd9d..42aded77f 100644 --- a/pkg/tcpip/transport/raw/endpoint.go +++ b/pkg/tcpip/transport/raw/endpoint.go @@ -298,6 +298,11 @@ func (ep *endpoint) Connect(addr tcpip.FullAddress) *tcpip.Error { ep.mu.Lock() defer ep.mu.Unlock() + if addr.Addr == "" { + // AF_UNSPEC isn't supported. + return tcpip.ErrAddressFamilyNotSupported + } + if ep.closed { return tcpip.ErrInvalidEndpointState } |