From 3e4102b2ead18aa768e1b8082d9865a9c567ce4e Mon Sep 17 00:00:00 2001 From: Andrei Vagin Date: Fri, 16 Aug 2019 19:30:59 -0700 Subject: 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 --- pkg/tcpip/stack/transport_test.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'pkg/tcpip/stack') 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 -- cgit v1.2.3