From 1cb8d2ffdd27de6f33d7d97446d8deefd5219d69 Mon Sep 17 00:00:00 2001 From: Will Norris Date: Wed, 15 Nov 2023 07:24:57 -0800 Subject: [PATCH] ipn/ipnlocal: only call serve handler if non-nil return early if handler is nil. Go ahead and return the error from handler, though in this case the caller isn't doing anything with it (which has always been the case). Updates #10177 Updates #10251 Signed-off-by: Will Norris --- ipn/ipnlocal/serve.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ipn/ipnlocal/serve.go b/ipn/ipnlocal/serve.go index e0c5a1e1d..2f2cfe5ea 100644 --- a/ipn/ipnlocal/serve.go +++ b/ipn/ipnlocal/serve.go @@ -93,9 +93,9 @@ func (b *LocalBackend) newServeListener(ctx context.Context, ap netip.AddrPort, if handler == nil { b.logf("[unexpected] local-serve: no handler for %v to port %v", srcAddr, ap.Port()) conn.Close() + return nil } - handler(conn) - return nil + return handler(conn) }, bo: backoff.NewBackoff("serve-listener", logf, 30*time.Second), }