Repository navigation
XCL_NETWORK=0: a bind to a network address binds to loopback - #570
tiagonleal wants to merge 1 commit into
Conversation
|
claude code session is invalid anyway, might as well remove it ;) |
|
Test run of Tested
Review: A bind to a network address (or to every interface) is moved to loopback with its port kept, so a title's sockets still bind and the firewall prompt from #568 no longer comes up; loopback binds go to the original. I found nothing to change. Not tested: no retail title or regression run (I have no unpacked game), no Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code. |
|
Merge-order note for the three
So the simplest order is #619 and #612 first, then a rebase of #570. Its hooks array then becomes
Read-only, not built. AI-assisted (Claude Code). |
With XCL_NETWORK=0 a retail title still bound UDP 3074 on 0.0.0.0: netoff refused connect, sendto and name lookups but not bind. Windows Firewall then asked to let the network in for xcl.exe (once per folder it runs from; "Allow" needs an administrator), and once allowed, the network reached the title's socket. A bind to a non-loopback IPv4 / IPv6 address now binds to 127.0.0.1 / ::1 on the same port, in the title's ws2_32 imports (ordinal 2) and in the system's ws2_32!bind. The bind succeeds as on a console without a network and loopback traffic still reaches the socket. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fc1e7a9 to
eaf034e
Compare
|
@FelipeCRamos dropped the session trailer; the commit is otherwise unchanged. @upipibi thanks for checking the merge order. Rebased onto AI-assisted (Claude Code). |
|
AMD RX 6750 XT data point for #570 (RDNA2, driver 32.0.21045.29003; Ryzen 7 5700X, 32 GB; Windows 11 Pro 26200; release builds)
main: PR: Written with Claude Code from runs on this machine. |
|
@zorde23 thanks for the RDNA2 run. For your last "not tested" point: #570 merged with the other eight open netoff PRs (#462, #612, #619, #807, #808, #821, #494, #299) builds and passes the whole suite on the RTX 5070 Ti (758 passed, 0 failed, 41 ignored; 7 netoff tests); the merge order and resolutions are in my comment on #568. AI-assisted (Claude Code). |
With
XCL_NETWORK=0a retail title still bound UDP 3074 on0.0.0.0:netoffrefusedconnect,sendtoand name lookups, but notbind. Windows Firewall then asked to let the network in forxcl.exe(once per folder it runs from; "Allow" needs an administrator), and once allowed, the network reached the title's socket. Fixes #568.A bind to a non-loopback IPv4 / IPv6 address now binds to
127.0.0.1/::1on the same port. The bind succeeds as on a console without a network, the title's loopback traffic still reaches the socket, nothing from the network does, and Windows does not ask.What is in it
crates/xcl/src/hle/netoff.rs: abindhook, in the title's ws2_32 imports (table(), ordinal 2) and in the system'sws2_32!bind(install_system_hooks), next toconnect's; loopback binds go through unchanged.a_bind_to_every_interface_stays_on_loopback: UDP and TCP binds to0.0.0.0:0end up on127.0.0.1, loopback traffic reaches them,[::]:0ends up on::1when the machine has IPv6. It fails without the hook (the socket stays on0.0.0.0).Tested
cargo build --workspace && cargo test --workspace -- --test-threads=4: 742 passed, 0 failed, 41 ignored (rebased ontomain47efa2e). SKIPPED:gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask,gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware(no wave64).cargo test -p xcl --lib netoffwith the systembindhook taken out: the new test fails (0.0.0.0≠127.0.0.1); with it: 3 passed.Get-NetUDPEndpoint25 s into each smoke run below:main0.0.0.0:3074; this PR127.0.0.1:3074, and the log saysXCL_NETWORK=0: a bind to a network address is bound to 127.0.0.1 instead (no network).Regression run
Not tested
::and expects IPv4 loopback connections to it (after this it is on::1only).sockaddr_in6form (no scope id) is rewritten too, but no test callsbindwith it.AI use