fix(libkernel): return EISCONN from sendto with an address on a connected datagram socket #7475
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/7475"
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 Bonjourcestmatt on 2026-10-18T08:52:34Z.
What
sendto(andsendmsgwith a name) with a destination address on an already connected datagram socket now fails withEISCONN(56). FreeBSD 11.4udp_output()doesif (inp->inp_faddr.s_addr != INADDR_ANY) { error = EISCONN; goto release; }when a destination is supplied (read insys/netinet/udp_usrreq.c, release/11.4.0). Linux and Winsock accept such a send, so the guest socket now checksgetpeernamefirst.GuestUdp.cpppinned the old behaviour in two places (sendtoandsendmsgwith an address on the connected sender); they now send without an address, and a new check pins theEISCONNresult.Overlap: open PRs #7201 and #7332 (macOS port) touch the same file and #7332 adds a similar
EISCONNtest expectation, because macOS already returnsEISCONNnatively; this change is the Linux/Windows side and does not conflict with the macOS host path, though the test lines may need a trivial merge.Tested
guest_udp_testsand all 27 udp/socket ctest tests pass; the full non-GPU suite passes (755 of 755, skipped ones included);python tools/check_conventions.py --base origin/mainpasses.mainwithout the fix; it follows from the host accepting the send. The two oldsendto/sendmsglines in the test did fail with the fix, which shows the new check is active.Checklist
main; no other open PR implements the same functions.mdfiles or images added to the repositoryAI-assisted: yes
🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-18T10:09:43Z.
Review: COMMENTED
Linux run, and the check against
mainthat the description leaves open.Machine: Linux x86_64, i7-8700, Ubuntu 26.04, GCC 15.2, Release,
BUILD_TESTING=ON, full build.Head
90c26b2e3merged ontomain9caecfd2d(clean merge).guest_udppasses, as do the other socket/network tests (ctest -R "udp|socket|^guest_sce_net$", 16 tests). On Linuxgetpeername()succeeds on the connected datagram socket, sosendtowith an address returns -1 with errno 56, andsend/sendmsgwithout one still deliver.GuestUdp.cpponly, onmain:guest_udpaborts at the newsendto(...) == -1 && errno == 56line (I numbered theRequirecalls to find it), since the host accepts the send. So the new check fails without the fix.ctest -E "^agc|gpu|vulkan|video_out"): 712/712, same asmain.Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
Imported from boykopovar/AnyPS5. Originally posted by ycarogabriel-lgtm on 2026-10-19T00:13:33Z.
Ran this on macOS, since it was not run there: Apple M1, macOS 26.6.2 (25G83), x86-64 build under Rosetta 2, AppleClang 21. Merged into the macOS host branch of #7332 (
57bccfbfc,mainatd71853cf2) together with #7121, #7475, #7490, #7507 and #7612;Releasebuild.guest_udppasses on macOS with this branch's version of the test.EISCONNforsendtowith an address on a connected UDP socket. That is why #7332 sends its addressed datagrams from a second, unconnected socket on macOS only.GuestUdp.cpp, as you expected, and it resolves to your version of the file.AI-assisted: yes (Claude Code). I ran the build and tests on my machine.
Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-21T02:49:20Z.
Independent Windows run of this PR (data only).
Environment: Windows 10 Pro 10.0.19045, Ryzen 7 5800X3D, WinLibs GCC 15.2.0 r7 (MinGW-w64 UCRT), Release, BUILD_TESTING=ON. Merge-tree of the PR head against
mainis clean. I built onlyguest_udp_tests;ctest -N -R guest_udplists exactly one test.Results (3 runs each):
guest_udppasses 3/3.core/libs/prx/libkernel/Socket/src/Udp.cppwith the version from the PR's merge base (e5c2b3c325), then rebuilt. The test fails 3/3 (exit 0xc0000409, a failed Require). I restored the PR's file afterwards.Not run: other platforms, the other tests in the same family, the full repository CTest, and any title or console run.
AI-assisted (Claude Code).
Pull request closed