mirror of
https://github.com/tailscale/tailscale.git
synced 2026-05-05 12:16:44 +02:00
wgengine/netstack: close forwarded TCP connections when incoming TCP dies
Updates #4522 Change-Id: I31a430da422b1e5fab834a2a670cddf448889ee6 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
parent
c6c752cf64
commit
5d4a361b4c
@ -734,11 +734,15 @@ func (ns *Impl) forwardTCP(client *gonet.TCPConn, clientRemoteIP netaddr.IP, wq
|
||||
_, err := io.Copy(client, server)
|
||||
connClosed <- err
|
||||
}()
|
||||
err = <-connClosed
|
||||
if err != nil {
|
||||
ns.logf("proxy connection closed with error: %v", err)
|
||||
select {
|
||||
case err := <-connClosed:
|
||||
if err != nil {
|
||||
ns.logf("proxy connection closed with error: %v", err)
|
||||
}
|
||||
ns.logf("[v2] netstack: forwarder connection to %s closed", dialAddrStr)
|
||||
case <-ctx.Done():
|
||||
ns.logf("[v2] netstack: context done, closing TCP forward conn to %s", dialAddrStr)
|
||||
}
|
||||
ns.logf("[v2] netstack: forwarder connection to %s closed", dialAddrStr)
|
||||
}
|
||||
|
||||
func (ns *Impl) acceptUDP(r *udp.ForwarderRequest) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user