XCL_NETWORK=0: the title still binds UDP 3074 on every interface (Windows Firewall asks, the network can reach it) #568

Open
opened 2026-11-26 04:25:57 +00:00 by github-bot · 1 comment
Owner

@⁠tiagonleal on GitHub · 2026-11-24 01:56 UTC · original

With XCL_NETWORK=0 the retail title (1.0.2.1) binds a UDP socket on 0.0.0.0:3074 at start. netoff refuses connect / sendto / name lookups, but not bind, so:

  • Windows Firewall shows "Do you want to allow public and private networks to access this app?" for xcl.exe, once per folder it runs from (every build tested from its own folder asks again; "Allow" needs an administrator).
  • If it is allowed, packets from the network reach the title's socket while it runs "without a network".

Seen: main 2997c9a and PR builds on it, release, Windows 11 Pro build 26300, RTX 5070 Ti, Ryzen 7 9800X3D. During a run (smoke.ps1 sets XCL_NETWORK=0):

PS> Get-NetUDPEndpoint -OwningProcess <pid of the xcl.exe running the title>
LocalAddress LocalPort
------------ ---------
0.0.0.0           3074

Proposed fix (small): with XCL_NETWORK=0, a bind to a non-loopback address (0.0.0.0, ::, or one of the machine's addresses) binds to loopback on the same port instead. The bind still succeeds, as on a console without a network, and the title's loopback traffic still works (socket pairs), but nothing from the network reaches it and Windows does not ask. Hooked like connect: in the title's ws2_32 imports (ordinal 2) and in the system's ws2_32!bind. I have it with a unit test and can open a PR.

AI use: Claude Code (Claude Opus 5.5) found this during test runs on my machine and wrote this issue.

**@⁠tiagonleal** on GitHub · 2026-11-24 01:56 UTC · [original](https://github.com/xcl-dev/xcl/issues/568) With `XCL_NETWORK=0` the retail title (1.0.2.1) binds a UDP socket on `0.0.0.0:3074` at start. `netoff` refuses `connect` / `sendto` / name lookups, but not `bind`, so: - Windows Firewall shows "Do you want to allow public and private networks to access this app?" for `xcl.exe`, once per folder it runs from (every build tested from its own folder asks again; "Allow" needs an administrator). - If it is allowed, packets from the network reach the title's socket while it runs "without a network". **Seen:** `main` 2997c9a and PR builds on it, release, Windows 11 Pro build 26300, RTX 5070 Ti, Ryzen 7 9800X3D. During a run (`smoke.ps1` sets `XCL_NETWORK=0`): ``` PS> Get-NetUDPEndpoint -OwningProcess <pid of the xcl.exe running the title> LocalAddress LocalPort ------------ --------- 0.0.0.0 3074 ``` **Proposed fix (small):** with `XCL_NETWORK=0`, a `bind` to a non-loopback address (`0.0.0.0`, `::`, or one of the machine's addresses) binds to loopback on the same port instead. The bind still succeeds, as on a console without a network, and the title's loopback traffic still works (socket pairs), but nothing from the network reaches it and Windows does not ask. Hooked like `connect`: in the title's ws2_32 imports (ordinal 2) and in the system's `ws2_32!bind`. I have it with a unit test and can open a PR. AI use: Claude Code (Claude Opus 5.5) found this during test runs on my machine and wrote this issue.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:25:57 +00:00
Author
Owner

@⁠tiagonleal on GitHub · 2026-11-24 15:03 UTC · original

Merge order for the nine open XCL_NETWORK=0 PRs, so they can go in as one batch with as few rebases as possible. Checked on main 930e8b4 with the heads #570 eaf034e43c, #612 bbf3174694, #619 2970626721, #807 62201a7d63, #808 13be36d054, #821 f9ef76857b, #462 17172b593a, #494 bf21fd8eff, #299 4d95ee8379.

Seven of them edit crates/xcl/src/hle/netoff.rs; pairwise (git merge-tree, XX = conflict):

570 612 619 807 808 821 462
570 – XX XX XX XX ok ok
612 XX – ok XX XX ok XX
619 XX ok – ok ok ok ok
807 XX XX ok – XX ok XX
808 XX XX ok XX – ok ok
821 ok ok ok ok ok – ok
462 ok XX ok XX ok ok –

Suggested order

  1. #821, #619, #808, #462, then #494 and #299 (other files): these six merge one after another with no conflict, and the hooks array stays right (19 entries, ; 19]: only #462 adds an entry).
  2. Then #612, #807, #570, each needing a rebase on the one before. Every conflict is two additions at the same place (a #[link_name] import, an O_* static, an orig_* function, a test, the hooks array's length); none changes another PR's logic. Two of them merge "cleanly" in git but leave the wrong length (both PRs change 18 to 19), so the array has to be recounted at each step: 20 after #612, 20 after #807 (it fills WSASendTo's spare slot), 21 after #570.

All nine merged in that order, with those resolutions, are on the branch netoff-nine-merged of my fork (e605d19), in case it saves the resolving.

Tested on that tree: NVIDIA GeForce RTX 5070 Ti (driver 32.0.16.1742), Ryzen 7 9800X3D, Windows 11 Pro 26300, rustc 1.100.0 MSVC, debug.

  • cargo build --workspace && cargo test --workspace -- --test-threads=4: 758 passed, 0 failed, 41 ignored. 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 netoff: 7 passed (the new tests of #570, #612, #807, #808 and #821, and the existing two that #462 and #619 extend).

Not tested: a retail run of the merged tree; AMD / Intel. I did not review the nine PRs' logic beyond the conflicts.

AI-assisted (Claude Code).

**@⁠tiagonleal** on GitHub · 2026-11-24 15:03 UTC · [original](https://github.com/xcl-dev/xcl/issues/568#issuecomment-7135393826) Merge order for the nine open `XCL_NETWORK=0` PRs, so they can go in as one batch with as few rebases as possible. Checked on `main` `930e8b4` with the heads #570 `eaf034e43c`, #612 `bbf3174694`, #619 `2970626721`, #807 `62201a7d63`, #808 `13be36d054`, #821 `f9ef76857b`, #462 `17172b593a`, #494 `bf21fd8eff`, #299 `4d95ee8379`. Seven of them edit `crates/xcl/src/hle/netoff.rs`; pairwise (`git merge-tree`, XX = conflict): | | 570 | 612 | 619 | 807 | 808 | 821 | 462 | |---|---|---|---|---|---|---|---| | **570** | – | XX | XX | XX | XX | ok | ok | | **612** | XX | – | ok | XX | XX | ok | XX | | **619** | XX | ok | – | ok | ok | ok | ok | | **807** | XX | XX | ok | – | XX | ok | XX | | **808** | XX | XX | ok | XX | – | ok | ok | | **821** | ok | ok | ok | ok | ok | – | ok | | **462** | ok | XX | ok | XX | ok | ok | – | **Suggested order** 1. **#821, #619, #808, #462**, then #494 and #299 (other files): these six merge one after another with no conflict, and the hooks array stays right (19 entries, `; 19]`: only #462 adds an entry). 2. Then **#612**, **#807**, **#570**, each needing a rebase on the one before. Every conflict is two additions at the same place (a `#[link_name]` import, an `O_*` static, an `orig_*` function, a test, the hooks array's length); none changes another PR's logic. Two of them merge "cleanly" in git but leave the wrong length (both PRs change `18` to `19`), so the array has to be recounted at each step: 20 after #612, 20 after #807 (it fills `WSASendTo`'s spare slot), 21 after #570. All nine merged in that order, with those resolutions, are on the branch `netoff-nine-merged` of my fork (`e605d19`), in case it saves the resolving. **Tested** on that tree: NVIDIA GeForce RTX 5070 Ti (driver 32.0.16.1742), Ryzen 7 9800X3D, Windows 11 Pro 26300, rustc 1.100.0 MSVC, debug. - `cargo build --workspace && cargo test --workspace -- --test-threads=4`: 758 passed, 0 failed, 41 ignored. 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 netoff`: 7 passed (the new tests of #570, #612, #807, #808 and #821, and the existing two that #462 and #619 extend). **Not tested:** a retail run of the merged tree; AMD / Intel. I did not review the nine PRs' logic beyond the conflicts. AI-assisted (Claude Code).
This discussion has been locked. Commenting is limited to contributors.
No description provided.