fix(libkernel): reject 0.0.0.0/8 multicast interface addresses on Windows with EADDRNOTAVAIL #25533
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/25533"
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 boykopovar/AnyPS5. Originally posted by mauroalvare on 2026-11-22T07:47:53Z.
What
On Windows, reject IPv4 multicast interface addresses in
0.0.0.0/8other than0.0.0.0(INADDR_ANY) withEADDRNOTAVAIL(49) inSetIpLevelOption(IP_MULTICAST_IF,IP_ADD_MEMBERSHIP,IP_DROP_MEMBERSHIP) before calling Winsock, matching FreeBSD 11.4 (inp_set_multicast_if/inp_join_group) instead of letting Winsock interpret those addresses as 24-bit interface indices:ZeroNetworkAddressincore/libs/prx/libkernel/Socket/src/SocketOptions.cppunder#ifdef _WIN32and returnedErrorAddressNotAvailablebefore::setsockoptfor non-zero addresses in0.0.0.0/8. Previously on Windows 11,0.0.0.1succeeded on bothIP_MULTICAST_IF(storing0.0.0.1instate.multicastInterface) andIP_ADD_MEMBERSHIP, while0.0.0.2,0.0.0.255,0.1.0.0, and0.255.255.255failedIP_MULTICAST_IFwithWSAEINVAL(guestEINVAL22).MulticastMembership(core/libs/tests/GuestSocketOptions.cpp) for{0,0,0,1},{0,0,0,2},{0,1,0,0}, and{0,255,255,255}acrossIP_MULTICAST_IF,IP_ADD_MEMBERSHIP, andIP_DROP_MEMBERSHIP, verifyingEADDRNOTAVAIL(49) and thatgetsockopt(IP_MULTICAST_IF)remains0.0.0.0.docs/dev/debt/changes/fix-libkernel-ip-multicast-if-mreqn.mdto close theIP_MULTICAST_IF on Windowsentry and document the0.0.0.0/8handling on Windows under[IP_ADD_MEMBERSHIP, IP_DROP_MEMBERSHIP, IP_MULTICAST_IF].tools/pr_overlap.py --branch fix/libkernel-win-multicast-addr): the four conflicting open PRs sharingSocketOptions.cpp/GuestSocketOptions.cpp(#12688,#12700,#12965onFIONBIO/BlockingConnectCanRetryAfterRefusaland#18108onCopy) do not touchSetIpLevelOptionorMulticastMembership.Tested
x86_64-ucrt-posix-seh-15.2.0-14.0.0-r7), CMake Release (BUILD_TESTING=ON), baseccc951d99223326c85ef71f451a557fad78460e5, branch head6c387b8aa1:SocketOptions.cppfix:ctest -R "^guest_socket_options$" --output-on-failurefailed (Exit code 0xc0000409:a 0.0.0.0/8 address other than INADDR_ANY must fail IP_MULTICAST_IF with EADDRNOTAVAIL (49)).ctest -R "^(guest_socket_error|guest_socket_options|guest_socket_options_multicast|guest_socket_stream_options|guest_udp|guest_kernel_socket_broadcast_debug_route_bounds|guest_kernel_socket_buf_timeout_bounds|public_headers)$" --output-on-failure -Vpassed 8/8 (public_headersverified 413 libraries and 34819 exports; neitherguest_socket_optionsnorguest_socket_options_multicastskipped).python tools/debt_fold.py --checkpassed (exit 0);python tools/check_conventions.py --base origin/mainpassed (All conventions checks passed.).Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-22T07:51:42Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
6c387b8aa1:tools/check_conventions.pypassed.guest_socket_options_testsbuilt cleanly.guest_socket_options,guest_socket_options_multicast):core/libs/prx/libkernel/Socket/src/SocketOptions.cppreverted tomainand the new tests kept, the suite fails: Restoring the change makes it pass again.Looks Good To Me
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-22T07:59:35Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the points below are optional.
What I ran
Reviewed head
6c387b8aa11650638127392a143f96fdebb757e3. I did not run commands or tests. The author reports Windows 11 tests and convention checks in the PR description; those results were not independently confirmed.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
Did not independently run the tests, conventions checks, or overlap check. Linux, macOS, and console behavior were not tested. All changed files listed in the manifest were read:
core/libs/prx/libkernel/Socket/src/SocketOptions.cpp,core/libs/tests/GuestSocketOptions.cpp, anddocs/dev/debt/changes/fix-libkernel-ip-multicast-if-mreqn.md. No files were excluded in the manifest.To get this to a good state
Nothing is required.