Repository navigation
netstack mode: SOCKS5 proxy is not closed when the engine stops; after down/up it serves through a dead stack #8182
Unanswered
Wombat164
asked this question in
Issue Triage
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Before posting
Affected area: Client / Agent
Deployment type: Self-hosted - advanced/custom deployment
Operating system or environment: Linux, Windows, Docker
Did this work before?
Not that I know of; same code on v0.80.0, v0.81.0-rc.1 and main.
Summary
In netstack mode the SOCKS5 proxy is not closed when the engine stops. After
netbird down+netbird upin the same process, the new proxy cannot bind and the old one keeps dialing through the closed netstack, so every connect fails until the daemon restarts.Current behavior
Expected behavior
The stopped engine's proxy is closed; the new engine's proxy binds and serves.
Steps to reproduce
Same on Windows 11 with the client as a service.
Environment and topology
Self-hosted combined server and client 0.80.0, one peer behind the relay.
Logs, status output, or debug evidence
client/iface/netstack/tun.go:Create()starts the proxy; onlyNetStackTun.Close()closes it.client/iface/device/device_netstack.go:TunNetstackDevice.Close()closes the configurer, the wireguard-go device and the UDP mux, but never callst.nsTun.Close().Related issues or discussions
#6812 and #7572 touch the same proxy; neither is this bug.
Impact
Any engine restart without a process restart (
down/up, profile switch, config change) silently breaks the proxy. Workaround: restart the daemon after anydown/up.Additional context
Likely fix: call
t.nsTun.Close()inTunNetstackDevice.Close(), plus a test that restarts the engine and dials through the proxy. Happy to open a PR once validated.All reactions