feat(libSceNet): keep TCP option state #11272
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/11272"
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 Queuse on 2026-10-25T23:18:13Z.
What
Store and read back TCP_MAXSEG, TCP_KEEPIDLE, TCP_KEEPINTVL and TCP_KEEPCNT for libSceNet stream sockets, including bounded output, input validation, socket isolation and keepalive inheritance through accept.
MSS starts at 536 for IPv4 and 1220 for IPv6, requires a peer before a set and raises accepted values below 216 to 216. Defaults and validation follow the PS5 13.60 libkernel_sys probes pinet4 and pmaxseg, with FreeBSD rules for unmeasured cases. The pmaxseg evidence also underlies #11251, which changes libkernel rather than these libSceNet paths.
These options keep guest state; they do not configure host MSS or keepalive timers. Connected MSS initially reports the stored family default rather than the negotiated segment. Direct libSceNet measurements on PS5 remain unavailable; the library debt records these limits.
#9525/#9542 and #10502 are now merged. This refresh preserves #10502's socket names/diagnostics alongside all TCP state and accept inheritance. Overlap snapshot
4a6693acf8reported a debt-only intersection with #9948; #11272-first remains proposed, awaiting confirmation. Five comparisons were incomplete at that snapshot (#5836, #9932, #11969, #12104, #12288). Their shared-file changes were inspected; this was not a combined runtime pass. #11969 has since closed in favor of the #12682 -> #12688 -> #12700 stack. Future transport/close coordination follows those successors; the original scan and runtime results below remain tied to their stated heads.Tested
Windows 11 x86-64, WinLibs MinGW-w64 GCC 15.2.0-r7, Ninja, Release. Exact head
53d19a3d87includes maindacca6bb88.guest_net_tcp_options,guest_net_protocol,guest_net_nodelay_readback,guest_net_buffer_validation,guest_net_socket_state,guest_net_boolean_readback,guest_net_oob_inlineandguest_sce_net: 8/8 pass, no skips.4a6693acf8: one reported debt intersection and five incomplete comparisons, as recorded above. A trial merge with that consulted main is clean; the runtime results belong to the published head/base, not that later merged tree.Hosted run 40667809045 passed the Windows job on
53d19a3d87, including configuration, registration and the host-only link step. Full product build/test steps and the Linux, relinker and specialized runtime jobs were skipped; this does not add a hosted guest TCP runtime or title run.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 MarcZX10 on 2026-10-25T23:22:15Z.
Review: APPROVED
I reviewed the state model and the socket lifecycle paths for TCP_MAXSEG and the keepalive options, including family defaults, stream checks, unconnected/listening MSS rejection, the 176-to-216 clamp, input/output truncation, per-socket isolation, timer bounds, and accept-time inheritance. The zero-as-default readback for keepalive values matches FreeBSD's
TP_KEEPIDLE/TP_KEEPINTVL/TP_KEEPCNTbehavior. The focused test covers both libSceNet and libkernel entry points and verifies that option state does not leak between sockets or between existing and newly accepted connections.On the exact head I ran
git diff --check,tools/check_conventions.py --base upstream/main, and the public-header audit; all pass (368 libraries, 12,202 exports). The author reports seven focused Windows tests passing and a deliberate failure against the previous libSceNet binary for the unconnected-MSS case. Hosted policy checks pass, but product-build jobs are skipped, and the cited PS5 measurements cover libkernel_sys rather than direct libSceNet calls; that limitation is documented. I found no blocking issue.