fix(libkernel): return EISCONN for addressed sends on connected UDP sockets #5388

Closed
MarcZX10 wants to merge 1 commit from upstream-pr/5388 into main
MarcZX10 commented 2026-10-13 18:33:19 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-13T18:33:19Z.


What

Carries Hussein Kadhim’s reviewed fix from #5374 onto current main, preserving the original commit author. sendto and sendmsg now return EISCONN when a family-valid destination address is supplied for an already-connected UDP socket. Addressless sends and unconnected UDP behavior remain covered by tests. The FreeBSD error ordering is not confirmed on console, and a failing host getpeername probe falls through to the existing send path.

Tested

Linux GCC 12.2, Ninja Release: built guest_udp_sendto_connected_tests and guest_udp_tests. CTest for the seven built socket/UDP tests passed (7/7), including IPv4 and IPv6 coverage in guest_udp_sendto_connected. The first grouped run had one transient abort in the existing guest_udp; it passed on direct rerun and on the subsequent full grouped rerun without a source change. Repository conventions and git diff --check pass. No console test was run.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw; no new unimplemented path
  • No notes, investigation .md files or images added to the repository
  • New third-party code is a submodule built from source; no third-party code added
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes; reviewed and tested by MarcZX100
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4847732590 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5388). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-13T18:33:19Z. --- ### What Carries Hussein Kadhim’s reviewed fix from #5374 onto current `main`, preserving the original commit author. `sendto` and `sendmsg` now return `EISCONN` when a family-valid destination address is supplied for an already-connected UDP socket. Addressless sends and unconnected UDP behavior remain covered by tests. The FreeBSD error ordering is not confirmed on console, and a failing host `getpeername` probe falls through to the existing send path. ### Tested Linux GCC 12.2, Ninja Release: built `guest_udp_sendto_connected_tests` and `guest_udp_tests`. CTest for the seven built socket/UDP tests passed (7/7), including IPv4 and IPv6 coverage in `guest_udp_sendto_connected`. The first grouped run had one transient abort in the existing `guest_udp`; it passed on direct rerun and on the subsequent full grouped rerun without a source change. Repository conventions and `git diff --check` pass. No console test was run. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except technical debt - [x] Unimplemented paths throw; no new unimplemented path - [x] No notes, investigation `.md` files or images added to the repository - [x] New third-party code is a submodule built from source; no third-party code added - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes; reviewed and tested by MarcZX100
likecrank-dotcom commented 2026-10-13 18:44:42 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by likecrank-dotcom on 2026-10-13T18:44:42Z.


Independent Windows validation by OpenAI Codex (AI-assisted). No code changes were made to this PR.

Validated PR head 179c5c6fa7831c75ba53e14fefb66a33d9faeff9 on Windows 11 Pro with WinLibs MinGW GCC 15.2.0 and CMake 4.4.4. Built guest_udp_sendto_connected_tests and guest_udp_tests; CTest guest_udp_sendto_connected and guest_udp each passed five consecutive runs (10/10 executions). tools/check_conventions.py against base 18c438b1092b09cef54e4cfacab441c009a6b501 and git diff --check also passed.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6152675769 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5388#issuecomment-6152675769). Originally posted by [likecrank-dotcom](https://github.com/likecrank-dotcom) on 2026-10-13T18:44:42Z. --- Independent Windows validation by OpenAI Codex (AI-assisted). No code changes were made to this PR. Validated PR head `179c5c6fa7831c75ba53e14fefb66a33d9faeff9` on Windows 11 Pro with WinLibs MinGW GCC 15.2.0 and CMake 4.4.4. Built `guest_udp_sendto_connected_tests` and `guest_udp_tests`; CTest `guest_udp_sendto_connected` and `guest_udp` each passed five consecutive runs (10/10 executions). `tools/check_conventions.py` against base `18c438b1092b09cef54e4cfacab441c009a6b501` and `git diff --check` also passed.
MarcZX10 commented 2026-10-13 18:46:55 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-13T18:46:55Z.


Thanks for independently validating the Windows build and running both UDP tests five times. This confirms the connected-send behavior on the platform where the change matters most; no follow-up code changes are needed.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6152714354 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5388#issuecomment-6152714354). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-13T18:46:55Z. --- Thanks for independently validating the Windows build and running both UDP tests five times. This confirms the connected-send behavior on the platform where the change matters most; no follow-up code changes are needed.
oneandonlydean commented 2026-10-14 02:27:47 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-14T02:27:47Z.


Closing: no title is known to reach this. With the queue at 700+ open PRs, please hold off on new PRs that don't name a title needing the change until it's down. If a title stops on this on current main, reopen with the title ID and the log line.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6159528170 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5388#issuecomment-6159528170). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-14T02:27:47Z. --- Closing: no title is known to reach this. With the queue at 700+ open PRs, please hold off on new PRs that don't name a title needing the change until it's down. If a title stops on this on current main, reopen with the title ID and the log line.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!5388
No description provided.