mirror of
https://github.com/tailscale/tailscale.git
synced 2026-11-24 10:41:19 -08:00
wgengine/netstack: close forwarded TCP connections when incoming TCP dies
Updates #4522 Change-Id: I31a430da422b1e5fab834a2a670cddf448889ee6 Signed-off-by: Brad Fitzpatrick <[email protected]>
This commit is contained in:
1 parent
c6c752cf64
commit
5d4a361b4c
1 file changed
+8
-4
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user