fix(libkernel): keep TCP_MAXSEG and the TCP keepalive options as measured on a PS5 #10327
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/10327"
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 orezraey on 2026-10-23T17:56:33Z.
What
The
IPPROTO_TCPoptionsTCP_MAXSEG,TCP_KEEPIDLE,TCP_KEEPINTVLandTCP_KEEPCNTmeasured on a retail PS5 (firmware 13.60) throughlibkernel_sys.sprxfrom a payload process. The source and console log are in this gist (pinet4). This branch is on top of #10320 (and so #10302), which edit the same debt entries and option state.On an unconnected stream socket the console:
TCP_MAXSEGas 536 and fails a new segment above it (1000, 70000) or below 176 (100) withEINVAL;TCP_KEEPIDLE,TCP_KEEPINTVLandTCP_KEEPCNTas 7200, 75 and 8, reads back what was set (60, 10, 3), restores the default when a keepalive time is set to 0, and stores a count of -1 as given.AnyPS5 failed every
IPPROTO_TCPoption exceptTCP_NODELAYwithENOPROTOOPT. The four are now kept per socket with those rules, and an accepted socket takes the keepalive values from its listener, as FreeBSD 11.4'ssyncache_socketdoes. They are not applied to the host socket; that, the negotiated segment size of a connected socket, and FreeBSD'shz-based limit on the keepalive times, which was not measured, are in a new debt entry.guest_underscore_entriesusedTCP_MAXSEGas its example of an unsupported option, so it now uses an unknown one.Tested
Windows 11, MinGW (winlibs).
guest_socket_stream_optionschecks the defaults, the segment limits, the keepalive read-back and the inheritance from the listener. The socket and net tests pass three runs in a row.-E "^agc_|^select_tests$") passes apart fromguest_kqueue, which fails only under-j 14, as onmain.tools/check_conventions.pypasses.tools/pr_overlap.py: #7511, #8448, #8921 touch nearby lines; whichever lands second keeps both.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 harisibrar1 on 2026-10-24T05:39:17Z.
Review: COMMENTED
Checked against main
7c2400d29b, the pinet4/pinet6 logs in your gist, and FreeBSD 11.4 tcp_usrreq.c, tcp_subr.c and tcp_syncache.c:optval + 40 >= V_tcp_minmss(tcp_usrreq.c:1686). Could you either measure, for example, 300, 176 and 175, or move that part to the "not measured" sentence? pinet6 suggests the PS5 TCP level isn't stock 11.4 here: option 0x80 reads 0 by default and 65536 after a set of 5, where 11.4's TCP_KEEPINIT would read 75 and then 5.Reviewed with AI assistance (Claude Code); the checks above were run locally on my machine.