Net: connect to a zero address disconnects a datagram socket instead of being refused (fixes #891) #1071
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!1071
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1071/head"
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?
@acleofe on GitHub · 2026-11-24 15:27 UTC · original
fix/net-connect-zero-address→main· +56 −2 · 1 files · 1 commits · closed without mergingWhat
connectandWSAConnectpass an address that reaches no one to the host: an IPv4/IPv6 address of zeros, or asockaddrof no family (AF_UNSPEC). Every other address is vetted as before, so only loopback connects.Why
Winsock documents that connecting a datagram socket to an address of zeros dissolves its association with its peer. The offline policy refused that address as off the machine (
WSAENETUNREACH), so a connected UDP socket stayed connected. An address of zeros never leaves the machine (a stream socket cannot connect to it on Windows), so passing it on does not weaken the policy.Test
a_zero_address_disconnects_a_datagram_socket: a UDP socket connected to a loopback peer is disconnected (getpeernamegivesWSAENOTCONN) byconnectwith0.0.0.0:0and with a zeroedAF_UNSPECsockaddr, and byWSAConnect; an off-machine address is still refused withWSAENETUNREACH. Before this change the first zero-addressconnectreturnedSOCKET_ERROR.cargo clippy --workspace --all-targets [--all-features] --locked -- -D warningsandcargo test --workspace --lockedpass.🤖 Generated with Claude Code
@ThomasHFWright on GitHub · 2026-11-24 15:53 UTC · original
Independent Linux/Wine validation of
d9741ec66ce5efd505aef2d51e75f53561af64b2, baseffe310e: the new regression fails under Wine 11.22, atnet.rs:939(assert!(!connected(u))). The zero-addressconnectreturns success, butgetpeernamestill succeeds.I compared direct
ws2_32calls with VIctory's wrappers in a separate diagnostic checkout. With a fresh IPv4 UDP socket connected to a loopback peer for every case, rawconnect, wrappedconnect, rawWSAConnect, and wrappedWSAConnectall give the same results:getpeernameafterwardsendafterward0.0.0.0:00.0.0.0:0AF_UNSPECsockaddrWSAENOTCONN(10057)WSAENOTCONN(10057)The wrapper still rejects the off-machine test address with
WSAENETUNREACHin every diagnostic case. All calls ran inside a network namespace with loopback only.This isolates the discrepancy to the host Winsock behavior on this Wine setup, rather than the new forwarding branch. Microsoft's
connectdocumentation specifies that the zero-address datagram operation disconnects and subsequentsendreturnsWSAENOTCONN. The workingAF_UNSPECpath is useful evidence for a Wine compatibility follow-up; I have not changed production code or checked IPv6 here.Full workspace unit/integration suite on the unmodified PR, all features, all 14 generated Windows MSVC test executables: 341 passed, 6 failed, 6 ignored. Matched baseline: 341 passed, 5 failed, 6 ignored. The extra failure is the new disconnect test. The other five remain the empty pipeline library (#347), missing Wine Winsock export (#217), checksum-rejection expectation, nested Cargo fixture build, and Windows xtask attempting to launch host Git. Native xtask separately passes all 4 tests; asset policy passes. Both Windows-target workspace Clippy configurations (all targets, with and without all features,
-D warnings) pass.Environment: Rust 1.98.1, Wine 11.22, RTX 5090 / NVIDIA 620.73.04, vkd3d-proton
30b0eb9bc12dc9f; natived3dcompiler_47for GPU fixtures, same runtime DLLs as baseline. Offline and offscreen. No game data, gameplay, native Windows/WARP, or Wine doctests. Aggregate counts include existing tests that return early without optional console compilers/DXIL validator. AI-assisted testing with Codex.@Zipettte on GitHub · 2026-11-24 16:29 UTC · original
Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at
d9741ec:cargo test -p victory-hlepasses, 96 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed).Tested with AI assistance (Claude).
Pull request closed