Net: forward zero-address datagram disconnects #2066
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!2066
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2066"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@fuzeofficlal on GitHub · 2026-11-25 04:20 UTC · original
fuzeofficlal:fix/hle-net-zero-address-disconnect-891→main· +156 −2 · 1 files · 1 commits · openFixes #891.
Summary
sockaddrforms (all-zeroAF_UNSPEC,0.0.0.0:0, and[::]:0) pastreachableinnet::connectandnet::WSAConnect(crates/victory-hle/src/modules/net.rs), forwarding the caller's(name, len)buffer unchanged to the host'sws2_32.dll.SOCK_DGRAM) sockets disconnect cleanly without leaving the machine, while stream (SOCK_STREAM) sockets receive the native Winsock error (WSAEADDRNOTAVAILfor0.0.0.0:0,WSAEAFNOSUPPORTfor all-zeroAF_UNSPEC), and non-zero ports (0.0.0.0:80) or external peers remain blocked withWSAENETUNREACH.Verification
modules::net::tests::zero_address_accepts_only_disconnect_formsmodules::net::tests::zero_address_disconnects_datagram_sockets_while_blocking_external_peers(covers UDP disconnect viaconnect/WSAConnect, TCPSOCK_STREAMWSAEADDRNOTAVAIL/WSAEAFNOSUPPORT, and blocked external/non-zero-port peers)cargo test -p victory-hle --locked,cargo clippy -p victory-hle --tests --locked -- -D warnings, andcargo xtask policy: passed.@jeremygold02 on GitHub · 2026-11-25 04:26 UTC · original
Triage verdict — Keep the disconnect fix, account for the Wine result (
a6d773e)Evidence
WSAENOTCONN, so the earlier platform difference remains relevant. Prior Wine comparisonChecks and limits
Next step
This verification was AI-assisted.
@fuzeofficlal on GitHub · 2026-11-25 05:00 UTC · original
Updated in
379e1baa— thanks @jeremygold02 for pointing back to the Wine 11.22 comparison in #1071 (@ThomasHFWright).On Wine,
ws2_32!connectdisassociates a datagram socket whensa_family == AF_UNSPEC(all-zerosockaddr), whereas forwardingAF_INET0.0.0.0:0verbatim leaves the peer associated on Linux/Wine (sendsucceeds instead of returningWSAENOTCONN).connectandWSAConnectnow canonicalize any acceptedzero_address(AF_UNSPEC,0.0.0.0:0, or[::]:0) to anAF_UNSPECall-zerosockaddrof the caller's length before calling hostws2_32.dll, giving consistent disassociation andWSAENOTCONNbehavior on both native Windows and Wine.@Marvisak on GitHub · 2026-11-25 10:24 UTC · original · edited 2026-11-25 11:23 UTC
Automated triage for the maintainers.
Needs work. This needs the maintainer's decision, because it still adds a path past
reachableincrates/victory-hle/src/modules/net.rs(connect,WSAConnect). The code itself now looks right to me.On your reply: confirmed in
1f723fb. TheAF_UNSPECrewrite is gone, soconnectandWSAConnectpass the caller's own(name, len)to the host whenzero_addressholds. That covers both earlier points: a stream socket now gets the host's own error, andWSAConnectbehaves however the host behaves for0.0.0.0:0. The newSOCK_STREAMassertions (WSAEADDRNOTAVAILfor0.0.0.0:0,WSAEAFNOSUPPORTfor all-zeroAF_UNSPEC) and the checks that0.0.0.0:80and off-machine peers still getWSAENETUNREACHtest the right things.zero_addressonly accepts a zero port and a zero address (plus zero flowinfo and scope for IPv6), so nothing it lets through can reach another machine.The remaining question is policy: whether the maintainer accepts a second exception beside the loopback rule in the
netmodule. CI: passing.Generated by Claude Code
@fuzeofficlal on GitHub · 2026-11-25 10:50 UTC · original
Updated in
1f723fb0per triage feedback:AF_UNSPECsockaddrrewrite soconnectandWSAConnectforward the caller's(name, len)unchanged to host Winsock whenzero_address(name, len)holds.zero_address_disconnects_datagram_sockets_while_blocking_external_peerswith aSOCK_STREAMTCP socket check verifyingconnectandWSAConnectwith0.0.0.0:0fail withWSAEADDRNOTAVAIL(10049) (and all-zeroAF_UNSPECfails withWSAEAFNOSUPPORT), while UDP datagram sockets disconnect cleanly and0.0.0.0:80/ external addresses stay blocked.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.