Repository navigation
Conversation
…NECT-BY-NAME-V6) WSAConnectByNameA/W hand "localhost" to the host as the literal 127.0.0.1 so the hosts file is never read. Windows itself resolves the name to ::1 and 127.0.0.1 and tries them in turn, and an IPv6 socket with IPV6_V6ONLY set, Windows' default, can reach only ::1: given 127.0.0.1 the host fails with WSAHOST_NOT_FOUND. A title that creates an IPv6 socket and connects it by name to localhost therefore always failed under the shim, and succeeds on Windows. Such a socket now gets the ::1 literal. IPv4 and dual-mode IPv6 sockets keep 127.0.0.1, which both reach. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
lixonik
left a comment
There was a problem hiding this comment.
Built ws2_offline_test at this head with MSVC on Windows 11. CTest passed with 76 checks and zero failures, including IPv6-only WSAConnectByNameA/W against an ::1 listener and the IPv4 and dual-mode controls. No findings from these checks.
AI-assisted.
The Winsock2 section still described the shim before this change; it now names the new behaviour and the test that covers it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Follow-up commit 664a6fc: the Winsock2 section of |
|
Marking Ready for Review since no WIP/blocker reason for draft status is specified on this PR, so it can enter normal CI and review. (AI-assisted triage.) |
|
Closing this PR because the legacy C++ Vulkan runtime (and legacy Python shader compiler) is now considered deprecated in favor of the new Rust Vulkan runtime (in progress) and the Rust DX12 runtime ( |
Claimed in the coordination issue as: WS2-CONNECT-BY-NAME-V6 (claim comment to follow)
What and why
runtime/shims/ws2_offline.cpphands "localhost" to the host'sWSAConnectByNameA/Was the literal127.0.0.1, so the hosts file is never read. Windows itself resolves the name to::1and127.0.0.1and tries them in turn. An IPv6 socket withIPV6_V6ONLYset, which is Windows' default forAF_INET6, can reach only::1: given127.0.0.1, the host fails withWSAHOST_NOT_FOUND. A title that creates an IPv6 socket and connects it to "localhost" by name therefore always failed under the shim.Measured with a small probe on Windows 11, with TCP listeners on
::1and127.0.0.1at one port:"localhost""127.0.0.1""::1"AF_INET6, default (V6ONLY)::1WSAHOST_NOT_FOUND::1AF_INET6, V6ONLY off::1::ffff:127.0.0.1::1AF_INET127.0.0.1127.0.0.1WSAHOST_NOT_FOUNDThe shim now asks the host for the socket's family (
SO_PROTOCOL_INFOW) andIPV6_V6ONLY, and gives an IPv6-only socket the::1literal. IPv4 and dual-mode IPv6 sockets keep127.0.0.1, which both reach. A dual-mode socket whose server listens on::1only still differs from Windows, as onmain: one literal cannot fall back like the host's resolver does.Tested
Windows 11, MSVC 14.44 (Build Tools), RelWithDebInfo:
ws2_offline_testgets a section 8:WSAConnectByNameAconnects an IPv4 socket to localhost at127.0.0.1,WSAConnectByNameAandWSAConnectByNameWconnect a default IPv6 socket at::1, and a dual-mode IPv6 socket at::ffff:127.0.0.1(skipped where IPv6 loopback is unavailable).main: the two IPv6-only checks fail.ctest -j 8over the 168 CPU tests, with this branch and WS2-UDP-DISCONNECT (ws2_offline: let connect dissolve a UDP association (WS2-UDP-DISCONNECT) #2241) merged: all pass exceptxmem_no_write_watch, whose split-reader check is the start race runtime tests: race a reader thread only once it reads (RT-TESTS-READER-START) #2131 fixes (it passes on its own).scripts/check_no_game_data.pyon both files.Not tested under Wine.
This and WS2-UDP-DISCONNECT (#2241) both change
ws2_offline.cppand its test, in different places; they merge cleanly in either order.GPUs tested: n/a (CPU tests)
AI-assisted: yes (Claude Code, Claude Opus 5.5)
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a: no translator change)🤖 Generated with Claude Code