diff options
author | Andrei Vagin <avagin@google.com> | 2019-08-16 19:30:59 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2019-08-16 19:32:14 -0700 |
commit | 3e4102b2ead18aa768e1b8082d9865a9c567ce4e (patch) | |
tree | 2566b0ba4f3f48effd854017924392800aceb691 /pkg/tcpip/stack | |
parent | 661b2b9f69855b6900195af84bf549341bdda0fe (diff) |
netstack: disconnect an unix socket only if the address family is AF_UNSPEC
Linux allows to call connect for ANY and the zero port.
PiperOrigin-RevId: 263892534
Diffstat (limited to 'pkg/tcpip/stack')
-rw-r--r-- | pkg/tcpip/stack/transport_test.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/pkg/tcpip/stack/transport_test.go b/pkg/tcpip/stack/transport_test.go index 8146e8444..1c811ab68 100644 --- a/pkg/tcpip/stack/transport_test.go +++ b/pkg/tcpip/stack/transport_test.go @@ -105,6 +105,11 @@ func (*fakeTransportEndpoint) GetSockOpt(opt interface{}) *tcpip.Error { return tcpip.ErrInvalidEndpointState } +// Disconnect implements tcpip.Endpoint.Disconnect. +func (*fakeTransportEndpoint) Disconnect() *tcpip.Error { + return tcpip.ErrNotSupported +} + func (f *fakeTransportEndpoint) Connect(addr tcpip.FullAddress) *tcpip.Error { f.peerAddr = addr.Addr |