cmd/natc: fix nil pointer

Fixes #13495

Signed-off-by: Fran Bull <fran@tailscale.com>
pull/13502/head
Fran Bull 2 months ago committed by franbull
parent 5f4a4c6744
commit 8b962f23d1

@ -456,6 +456,11 @@ func (c *connector) ignoreDestination(dstAddrs []netip.Addr) bool {
}
func proxyTCPConn(c net.Conn, dest string) {
if c.RemoteAddr() == nil {
log.Printf("proxyTCPConn: nil RemoteAddr")
c.Close()
return
}
addrPortStr := c.LocalAddr().String()
_, port, err := net.SplitHostPort(addrPortStr)
if err != nil {

Loading…
Cancel
Save