summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorjwijenbergh <jeroenwijenbergh@protonmail.com>2024-07-10 14:37:14 +0200
committerJeroen Wijenbergh <46386452+jwijenbergh@users.noreply.github.com>2024-07-17 14:00:03 +0000
commit7f8af5845ddec1816f93a2cb013f0818c19caab3 (patch)
tree66f3cfbac66d5cfbb144bca78e926b58a80ad624 /client
parent8c01291b23cb2fb11d4e4794b6f7369b13d3c840 (diff)
Client Proxy: Fix theoretical race condition
Diffstat (limited to 'client')
-rw-r--r--client/proxy.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/client/proxy.go b/client/proxy.go
index b39af32..ed17c82 100644
--- a/client/proxy.go
+++ b/client/proxy.go
@@ -80,6 +80,7 @@ func (p *Proxy) Tunnel(ctx context.Context, peer string) error {
}
cctx, cf := context.WithCancel(ctx)
p.cancel = cf
+ client := *p.c
p.mu.Unlock()
defer func() {
p.mu.Lock()
@@ -87,7 +88,7 @@ func (p *Proxy) Tunnel(ctx context.Context, peer string) error {
p.mu.Unlock()
}()
// we set peer IPs to nil here as proxyguard already does a DNS request for us
- return p.c.Tunnel(cctx, peer, nil)
+ return client.Tunnel(cctx, peer, nil)
}
// StartProxyguard starts proxyguard for proxied WireGuard connections