libkernel: sendto with an address on a connected UDP socket succeeds where FreeBSD returns EISCONN; fix branch ready #5374
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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 husseinkad on 2026-10-13T18:16:10Z.
sendtoandsendmsgwith a destination address on a connected UDP socket succeed. FreeBSD 11.4udp_outputfails that call withEISCONN(56): a connected datagram socket must be sent withsend, or withsendtoand a NULL address. A guest that sends addressed datagrams from a connected socket (and expects the error to find its mistake, or relies on the console's behaviour) gets silent success here.Fix branch: https://github.com/husseinkad/AnyPS5/tree/fix/kernel-udp-sendto-eisconn (one commit on a recent main:
Socket/src/Udp.cpp,tests/GuestUdpSendtoConnected.cpp, and a debt entry indocs/dev/debt/libkernel.md).sendto_nid_postfixusesgetpeernameto detect a connected datagram socket and returnsEISCONNwhen an address is given;sendmsg_nid_postfixcallssendto_nid_postfix, so it gets the same check. The existingGuestUdp.cppsent addressed datagrams from a connected socket, so that part of the test now uses an unconnected socket for those sends.Checks:
sendtoandsendmsg, and sending again after disconnect) fails on main ("sendto with an address on a connected socket must fail with EISCONN (56)") and passes with the change; the 27-test socket group passes.sendtoandsendmsgwith a family-valid address on an already connected UDP socket, which now return 56 where main returned success (or 49 or 13). Unchanged: unconnected UDP,send,write, a NULL address, wrong-family or short addresses (still 47) and every TCP result. Delivery payloads all matched.check_conventions.pyis clean andpr_overlap.pyfinds no overlap.Not covered: the check adds one
getpeernamecall per addressed UDP send, and a failinggetpeernamefalls through to the normal send. The family check (47) runs beforeEISCONNhere, and FreeBSD's order is not verified.sceNetSendtois unchanged,sendmmsgis not exported, and the behaviour comes from the FreeBSD source, not a console run. Only Windows was built and run.AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-13T18:33:25Z.
I opened #5388 carrying your commit onto current
main, with your original commit author preserved. On Linux GCC 12.2/Ninja Release,guest_udp_sendto_connected_testsandguest_udp_testsbuilt; the seven socket/UDP CTests passed (7/7), covering IPv4 and IPv6 in the new regression. One initial grouped run had a transient abort in the existingguest_udp; it passed on direct rerun and on the subsequent full group rerun without a source change. Conventions passed. No console run was performed.AI-assisted: yes; reviewed and tested by MarcZX100.
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-14T06:55:00Z.
Closing: no title is known to reach this, and functions are only changed when a title needs them. #5388 is closed for the same reason. If a title stops on or misbehaves because of it on current main, comment here with the title ID and the log line.