From ff6ab44fcbc098937e404bde148aa4cd9f0b5adb Mon Sep 17 00:00:00 2001 From: Vladimir Popov Date: Tue, 12 Oct 2021 10:59:24 +0700 Subject: [PATCH] Fix error handling in memifproxy Signed-off-by: Vladimir Popov --- .../mechanisms/memif/memifproxy/proxy_listener.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/networkservice/mechanisms/memif/memifproxy/proxy_listener.go b/pkg/networkservice/mechanisms/memif/memifproxy/proxy_listener.go index 0d9c5e15..a8a38fa4 100644 --- a/pkg/networkservice/mechanisms/memif/memifproxy/proxy_listener.go +++ b/pkg/networkservice/mechanisms/memif/memifproxy/proxy_listener.go @@ -66,12 +66,12 @@ func (p *proxyListener) accept() { defer func() { _ = p.Close() }() for { in, err := p.listener.Accept() - if optErr, ok := err.(*net.OpError); ok && !optErr.Temporary() { + if optErr, ok := err.(*net.OpError); !ok || !optErr.Temporary() { // TODO - perhaps log this? return } out, err := net.Dial(memifNetwork, p.socketFilename) - if optErr, ok := err.(*net.OpError); ok && !optErr.Temporary() { + if optErr, ok := err.(*net.OpError); !ok || !optErr.Temporary() { _ = in.Close() // TODO - perhaps log this? return