Skip to content

Commit 5bfdba2

Browse files
committed
nilaway: tcp.go
1 parent 21cb9b3 commit 5bfdba2

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

intra/tcp.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,11 +341,15 @@ func (h *tcpHandler) Proxy(gconn *netstack.GTCPConn, src, target netip.AddrPort)
341341

342342
if h.loopDetected(smm) {
343343
log.I("tcp: loop: break %s => %s via %s for %s; exiting...", src, dstipp, smm.PID, uid)
344-
px, _ = h.prox.ProxyTo(dstipp, uid, onlyExitPid)
344+
px, err = h.prox.ProxyTo(dstipp, uid, onlyExitPid)
345345
smm.PID = ipn.Exit
346346
smm.RPID = ""
347347
}
348348

349+
if px == nil || err != nil { // unlikely
350+
continue
351+
}
352+
349353
if cont, err = h.handle(px, gconn, src, dstipp, delayForHappyEyeballs, smm); err == nil {
350354
return allow // smm instead queued by handle() => forward()
351355
} else {

0 commit comments

Comments
 (0)