docs(libSceNet): list the socket-level options titles set that sceNetSetsockopt refuses #11968

Merged
milescoviello merged 2 commits from upstream-pr/11968 into main 2026-11-02 12:28:33 +00:00
milescoviello commented 2026-10-27 14:07:14 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-27T14:07:14Z.


What

sceNetSetsockopt returns EOPNOTSUPP for any SOL_SOCKET option it doesn't handle, but docs/dev/debt/libSceNet.md doesn't say which ones titles actually set. The existing SO_ONESBCAST entry shows such a failure can matter: PPSA34501 set it and crashed later while it failed.

I read the level and optname at every sceNetSetsockopt call site in ten titles' relinked executables. These socket-level options take that path:

Option Name (shadPS4 net_types.h) Call sites
0x1201 SO_POLICY 1 each in Borderlands 4 (PPSA01494 01.100.002), Astro Bot (PPSA21564 01.007.000), MXGP 26 (PPSA30839 01.003.000), Super Meat Boy 3D (PPSA31162 02.000.001)
0x20000 SO_USECRYPTO 2 in Ghost of Tsushima (PPSA02225 02.024.000)
0x80 SO_LINGER 1 in Crimson Desert (PPSA25286 01.000.568), with an 8-byte {0, 0} (linger off)
0x200 SO_REUSEPORT 1 in Metal Gear Solid 4 (PPSA18194 01.004.003, app.elf); 1 in Astro Bot (PPSA21564 01.007.000), where a helper picks it instead of SO_REUSEADDR (0x4) when its own socket-type field is 1 or 3, before one shared call

Crimson Desert tests the result and continues after a failure. I didn't follow the others' error paths.

This adds one Functional entry listing them, with titles named by PPSA id only. SO_LINGER and SO_REUSEPORT are standard FreeBSD 11.4 options. What the console does for SO_POLICY and SO_USECRYPTO is unknown, so the entry says that.

SO_CONNECTTIMEO (0x1109), which MGS4 sets four times, is left out on purpose: #11571 (NevesHenry) implements it and adds its own entry.

How

Changed: docs/dev/debt/libSceNet.md, one new entry under Functional (772 characters), after the SO_ONESBCAST entry. No code change.

Re-check after review (head 50fd1824e2): my first scan read only the constant loaded just before each call, so it missed Astro Bot's branch-selected SO_REUSEPORT (oneandonlydean found it). I re-read every sceNetSetsockopt call site in the ten titles from the previous call to the call itself, so that every optname a branch can pass is counted. Astro Bot's helper (0x31e1a0 in its eboot) is the only site that picks between two constants, and no site passes a register-sourced option. The other refused options match the table above.

Tested

Docs only. tools/check_conventions.py --base upstream/main passes. tools/pr_overlap.py couldn't compare #5836, #9578, #9932 and #10502, which edit this file but already conflict with main. None of them adds or changes an entry next to the SO_ONESBCAST one. #11571 adds its entry elsewhere in the file and merges cleanly with this.

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 (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5035271240 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11968). Originally posted by [milescoviello](https://github.com/milescoviello) on 2026-10-27T14:07:14Z. --- ### What `sceNetSetsockopt` returns `EOPNOTSUPP` for any `SOL_SOCKET` option it doesn't handle, but `docs/dev/debt/libSceNet.md` doesn't say which ones titles actually set. The existing `SO_ONESBCAST` entry shows such a failure can matter: PPSA34501 set it and crashed later while it failed. I read the `level` and `optname` at every `sceNetSetsockopt` call site in ten titles' relinked executables. These socket-level options take that path: | Option | Name ([shadPS4 `net_types.h`](https://github.com/shadps4-emu/shadPS4/blob/main/src/core/libraries/net/net_types.h)) | Call sites | |---|---|---| | `0x1201` | `SO_POLICY` | 1 each in Borderlands 4 (PPSA01494 01.100.002), Astro Bot (PPSA21564 01.007.000), MXGP 26 (PPSA30839 01.003.000), Super Meat Boy 3D (PPSA31162 02.000.001) | | `0x20000` | `SO_USECRYPTO` | 2 in Ghost of Tsushima (PPSA02225 02.024.000) | | `0x80` | `SO_LINGER` | 1 in Crimson Desert (PPSA25286 01.000.568), with an 8-byte `{0, 0}` (linger off) | | `0x200` | `SO_REUSEPORT` | 1 in Metal Gear Solid 4 (PPSA18194 01.004.003, `app.elf`); 1 in Astro Bot (PPSA21564 01.007.000), where a helper picks it instead of `SO_REUSEADDR` (`0x4`) when its own socket-type field is 1 or 3, before one shared call | Crimson Desert tests the result and continues after a failure. I didn't follow the others' error paths. This adds one Functional entry listing them, with titles named by PPSA id only. `SO_LINGER` and `SO_REUSEPORT` are standard FreeBSD 11.4 options. What the console does for `SO_POLICY` and `SO_USECRYPTO` is unknown, so the entry says that. `SO_CONNECTTIMEO` (`0x1109`), which MGS4 sets four times, is left out on purpose: #11571 (NevesHenry) implements it and adds its own entry. ### How Changed: `docs/dev/debt/libSceNet.md`, one new entry under Functional (772 characters), after the `SO_ONESBCAST` entry. No code change. **Re-check after review (head `50fd1824e2`):** my first scan read only the constant loaded just before each call, so it missed Astro Bot's branch-selected `SO_REUSEPORT` (oneandonlydean found it). I re-read every `sceNetSetsockopt` call site in the ten titles from the previous `call` to the call itself, so that every `optname` a branch can pass is counted. Astro Bot's helper (`0x31e1a0` in its eboot) is the only site that picks between two constants, and no site passes a register-sourced option. The other refused options match the table above. ### Tested Docs only. `tools/check_conventions.py --base upstream/main` passes. `tools/pr_overlap.py` couldn't compare #5836, #9578, #9932 and #10502, which edit this file but already conflict with `main`. None of them adds or changes an entry next to the `SO_ONESBCAST` one. #11571 adds its entry elsewhere in the file and merges cleanly with this. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [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](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
THEMANnt commented 2026-10-28 10:54:41 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by THEMANnt on 2026-10-28T10:54:41Z.

Review: APPROVED


Reviewed 50fd1824e2d358e8e1809f1b0248ee5cc3a70b04 against author merge base eece5da035096f4a6fd936c3dfacf667f474f3af — approve the documentation change.

The unsupported SOL_SOCKET options remain documented as EOPNOTSUPP in the host. Added option numbers and caller values retain the distinction between observed calls and unknown private console behavior.

Validation: checked the submitted Markdown diff, pinned implementation references and relative links; git diff --check passed. This changes documentation only. Title disassembly and console observations were not independently reproduced; no runtime regression result is claimed.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5681486491 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11968#pullrequestreview-5681486491). Originally posted by [THEMANnt](https://github.com/THEMANnt) on 2026-10-28T10:54:41Z. **Review:** APPROVED --- Reviewed `50fd1824e2d358e8e1809f1b0248ee5cc3a70b04` against author merge base `eece5da035096f4a6fd936c3dfacf667f474f3af` — approve the documentation change. The unsupported SOL_SOCKET options remain documented as EOPNOTSUPP in the host. Added option numbers and caller values retain the distinction between observed calls and unknown private console behavior. Validation: checked the submitted Markdown diff, pinned implementation references and relative links; `git diff --check` passed. This changes documentation only. Title disassembly and console observations were not independently reproduced; no runtime regression result is claimed.
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!11968
No description provided.