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 
Updates 

Signed-off-by: Will Norris <will@tailscale.com>
This commit is contained in:
Will Norris 2023-11-15 07:24:57 -08:00 committed by Will Norris
parent 05d4210dbe
commit 1cb8d2ffdd

@ -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),
}