Fix: udp crash in tunnel

This commit is contained in:
gVisor bot 2019-05-16 18:40:20 +08:00
parent e7f4103c85
commit 7528b012c4

View File

@ -159,10 +159,11 @@ func (t *Tunnel) handleConn(localConn C.ServerAdapter) {
if metadata.NetWork == C.UDP { if metadata.NetWork == C.UDP {
pc, addr, err := proxy.DialUDP(metadata) pc, addr, err := proxy.DialUDP(metadata)
defer pc.Close()
if err != nil { if err != nil {
log.Warnln("Proxy[%s] connect [%s --> %s] error: %s", proxy.Name(), metadata.SrcIP.String(), metadata.String(), err.Error()) log.Warnln("Proxy[%s] connect [%s --> %s] error: %s", proxy.Name(), metadata.SrcIP.String(), metadata.String(), err.Error())
return
} }
defer pc.Close()
t.handleUDPOverTCP(localConn, pc, addr) t.handleUDPOverTCP(localConn, pc, addr)
return return