XCL_NETWORK=0: IPv4-mapped loopback (::ffff:127.x.x.x) goes through #614
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/619"
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?
Imported from ivall/xcl. Originally posted by Kalmarv on 2026-11-24T02:34:15Z.
With
XCL_NETWORK=0loopback is let through, because titles make socket pairs.loopbackknew 127.0.0.0/8 and::1, but not the IPv4-mapped form: a socket for both IPv6 and IPv4 (IPV6_V6ONLYoff) names 127.0.0.1 as::ffff:127.0.0.1. On main508a0c7the hookedconnectandsendtorefuse that address withWSAENETUNREACH, although its listener is on this machine. The mapped form of 127.0.0.0/8 now counts as loopback.Follow-up to #305 (closed).
What is in it
crates/xcl/src/hle/netoff.rs,loopback: asockaddr_in6whose address is::ffff:127.x.x.xis loopback.hle::netoff::tests::only_loopback_goes_through: the mapped form of 127.0.0.1 is loopback, that of 8.8.8.8 is not.Tested
cargo test --workspace -- --test-threads=4on2970626(this PR, on main508a0c7): 680 passed, 0 failed, 41 ignored (thexcllibrary: 640 passed, 21 ignored). SKIPPED GPU tests: 2, bothno wave64(gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware).508a0c7with only the two new asserts: fails at the first (the mapped 127.0.0.1);::ffff:127.0.0.1.508a0c7with the hooks:connectandsendtoare refused (10051);2970626merged onto maindd2ae9a: 690 passed, 0 failed, 41 ignored (thexcllibrary: 650 passed, 21 ignored), no SKIPPED tests.Regression run
Our own runs, one after the other on the machine under Tested (RTX 5070 Ti), release builds, no uncommitted changes.
main:
PR:
Not tested
getaddrinfo("::ffff:127.0.0.1")is still refused (local_nameis unchanged).WSASendTo, which refuses every destination, loopback too, before and after this change.17172b5), whoseConnectExdetour uses the sameloopback.AI use
🤖 Generated with Claude Code
Imported from ivall/xcl. Originally posted by MesshM on 2026-11-24T03:11:59Z.
Test run of
29706267219676b8beab0d05dc8cab5364789014on AMD RDNA4. I merged it onto currentmaindd2ae9alocally (clean merge) and tested that tree.Tested
stable-x86_64-pc-windows-msvc, debugcargo build --workspace+cargo test --workspace -- --test-threads=4on the merge: 690 passed, 0 failed, 41 ignored, exit code 0;xcllib tests 650 passed, 0 failed, 21 ignoredSKIPPED;only_loopback_goes_through(with the new mapped cases) passes.Review: The mapped form is checked on the right bytes of
sin6_addr(ten zero bytes,ff ff, then 127), and the test builds anAF_INET6sockaddr with the address at offset 8, so it exercises the same layout the hook reads. A mapped non-loopback address (8.8.8.8) is still refused. I found nothing to change.Not tested: no retail title or regression run (I have no unpacked game), no
XCL_SAMPLE_*tests, release build; the PR's head on its old base was not run, only its merge ontomain.Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code.
Imported from ivall/xcl. Originally posted by tiagonleal on 2026-11-24T12:49:25Z.
Windows / NVIDIA test of #612 (
bbf3174694) and #619 (2970626721) merged together ontomain47efa2e(both clean), with #570 rebased on top.Tested
cargo build --workspace && cargo test --workspace -- --test-threads=4on47efa2e+ #612 + #619 + #570: 743 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: 4 passed (only_loopback_goes_through,the_systems_own_network_functions_refuse,the_systems_wsasendmsg_refuses,a_bind_to_every_interface_stays_on_loopback).note_bindnext to the rewrittenloopbackdoc,O_BIND/O_WSA_SEND_MSG, the hooks array); resolved with both entries and the array at 20. I'll push that rebase to #570 once these two are in.Not tested: a retail run of this combined tree; AMD / Intel.
Run and written with Claude Code (Claude Opus 5.5).
upstream-sync referenced this pull request2026-11-24 19:06:45 +00:00
Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-25T06:37:04Z.
Empirical test report (
29706267)Hardware / environment
29706267219676b8beab0d05dc8cab5364789014on Windows x64, OS build10.0.26200.9974.AMD64 Family 23 Model 113 Stepping 0, AuthenticAMD.1.100.0(0ef1bc386,x86_64-pc-windows-msvc), Cargo1.100.0, and DXC1.9.2609.5(01b62ad47). The test profile was unoptimized, with debug info and incremental compilation disabled.XCL_ADAPTER=NONE_CPU_ONLYandRUST_TEST_NOCAPTURE=1. Both commands ran directly, outsideInvoke-ArcTest.ps1, with no Arc GPU mutex hold.Commands and results
cargo test --workspace --no-run— exit 0. Cargo built the workspace test executables. This step compiled only.cargo test -p xcl --lib hle::netoff::tests:: -- --test-threads=1— exit 0. 2 passed / 0 failed / 0 ignored / 0 skipped. Libtest filtered out 659 tests. The skipped count is the number of case-sensitive^SKIPPEDlines in the combined output.AtomicU32::fetch_updatein XGameRuntime. The PR extends one unit test and changes no integration tests.Observed behavior
only_loopback_goes_throughaccepted::ffff:127.0.0.1and rejected::ffff:8.8.8.8as socket address inputs. Its existing IPv4 and IPv6 loopback checks also passed.the_systems_own_network_functions_refuseconfirmed that the system hooks reject the WinHTTP and WinINet calls and the external name lookup in the test. Thelocalhostlookup reached Winsock.Not tested
AI use
Verified with T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high). Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against pr619-focused.log and published.
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T12:43:44Z.
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)Thanks!
Imported from ivall/xcl. Originally posted by throny on 2026-11-28T06:50:20Z.
merge-check claim
head:
2970626721Imported from ivall/xcl. Originally posted by throny on 2026-11-28T07:07:01Z.
merge-check
base:
e429936chead:
2970626721merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2126 passed, 9 failed, 48 ignored (the PR extends an existing test) (26 SKIPPED lines). The 9 failures are main's own at
e429936con this GPU (reported with a bisect on #3041: they arrive with the merge of #2959); the set is identical with and without this PR. Base alone: 2126 passed, 9 failed, 48 ignored.review: none. The new case accepts exactly ::ffff:127.0.0.0/104: ten zero bytes, ff ff, then 127. It does not accept the IPv4-compatible form (::127.0.0.1), the SIIT form, NAT64 (64:ff9b::/96) or 6to4 addresses; the length check covers the 16 address bytes; the scope id is ignored, which does not matter for loopback. So XCL_NETWORK=0 gains one more loopback spelling and nothing else. For whoever merges: a rebase conflict between #570 and this PR is reported in the thread (merge order).
performance: a few byte compares per hooked connect or sendto.
verdict: safe to merge
hardware / tool and model: RTX 4080 16 GB (621.40), i9-12900K, Windows 11 26300, Rust 1.100.0, debug. Claude Code; merge, build and suite run by Claude Fable 5.2, diff review by Claude Opus 5.5 (every hunk read; nothing run on the GPU beyond the suite).
Imported from ivall/xcl. Originally posted by tiagonleal on 2026-11-29T11:15:11Z.
merge-check
base:
d8bd9a3820head:
2970626721merge: clean (trial merge 2b96eedc, local, not pushed;
git diff --checkclean).mainmoved tod2ec83dewhile this ran:netoff.rsdid not change in between and the trial merge ontod2ec83deis clean too; build and tests below are on thed8bd9a38merge.build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -j 8 -- --test-threads=4 -> 2614 passed, 4 failed, 49 ignored; SKIPPED: 26 (21 "no wave64" on this GPU, 3 per-lane f16 forms refused, 2 "no heap windows"); failing:
gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_0to_3, which fail on the base too (base alone: 2613 passed, 5 failed, 49 ignored; its fifth was the intermittent e2e check of #3382).hle::netoff::tests::only_loopback_goes_through, which carries the two new asserts, passed.review: whole diff read (+11/-2,
netoff.rs). The new arm ofloopback()accepts exactly::ffff:127.0.0.0/104: bytes 0 to 9 zero, 10 and 11ff, 12 equal to 127. The existinglen >= 24guard covers every byte it reads. Nothing else becomes loopback; a mapped8.8.8.8is still refused, and the test checks both. The first new assert fails without the change by construction, since the old expression needs byte 10 to be 0.loopback()is shared, so the change also reachessendtoandWSAConnect, as intended. One thing for whoever merges: my #570 adds a function right aboveloopback()and the two PRs touch the same doc line, so the second one to land needs a small rebase. With both in, a bind to::ffff:127.x.x.xis left as it is, which is right. Not covered: real dual-stack traffic from a title.performance: a few byte compares per hooked call, and only with
XCL_NETWORK=0. A 60 s smoke of the merged tree shows 1699 frames against 1691 and 1695 for two runs of the base.verdict: safe to merge
hardware / tool and model: NVIDIA GeForce RTX 5070 Ti 16 GB (617.42), AMD Ryzen 7 9800X3D, Windows 11 Pro 26300, rustc 1.100.0, debug / Claude Code: Claude Fable 5.2 ran the merge, build and suite; Claude Opus 5.5 read the diff.