feat(libSceNet): receive urgent TCP data inline #9543
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/9543"
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-22T01:10:19Z.
What
Implement
SO_OOBINLINEforsceNetSetsockoptandsceNetGetsockopt. TCP enables native inline urgent data; other socket types retain the flag, as FreeBSD socket flags do. Readback returns bit0x100with truncated output. Semantics follow FreeBSD 11.4 sosetopt/sogetopt and the Winsock OOB contract; PS5 urgent-pointer and signalling differences remain unverified in debt.Merge after #9525 because both add a getter path beside the argument checks.
Tested
Windows 11 x86-64, WinLibs MinGW-w64 GCC 15.2.0-r7, Ninja, Release. Head
8d1b7bc6f5includes mainb4d8e8bb3b.guest_net_oob_inline,guest_net_protocol,guest_net_nodelay_readbackandguest_net_buffer_validation: 4/4 pass, no skips.19fe176ddcare clean. Its later closed-stream polling, IPv6 text and unrelated libc/kernel changes are outside these option paths; the local runtime results above belong to the stated head/base.Integration order remains #9523 → #9542 → #9515 → #9578 and #9525 → #9543. #9930 and #9931 are now merged, so their former prerequisites for #9932/#9948 are satisfied; #9948 still follows #9932. #6044 was closed without merging the test relocation. #10097 follows #9523 as its author confirmed. The #5836 peer/broadcast order remains a proposal. The #9525/#10949 intersection concerns CMake test registration, with no option-behavior dependency; the author of #10949 confirmed #9525-first and declared
Depends on: #9525.Canonical overlap snapshot
7e4f6e0440: confirmed intersections with #9525. 7 comparisons remain incomplete because those branches conflict with the base: #5836, #7201, #9727, #9733, #9932, #9948, #10502. Manual inspection covers peer/broadcast transport mapping, macOS paths, argument validation, socket records and diagnostic output. Preserve every option path, field, canonical declaration, fixture and debt entry during integration; these checks do not establish a combined runtime pass with the conflicting branches.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-22T01:15:58Z.
Review: CHANGES_REQUESTED
The accepted connection does not inherit the listener’s
SO_OOBINLINEstate.sceNetAcceptconstructs a freshSock connectionwith default fields and does not copy this option or set it on the accepted native socket. FreeBSD 11.4 copieshead->so_optionsinto the new socket insonewconn(minus onlySO_ACCEPTCONN), so an option set beforelistenis inherited by accepted sockets. The current test only checks a listener configured before listen, but its expected accepted value is256even when testing the first listener state? In this test the loop sets listener through {1,-1,0,256,0,1}, leaving it enabled, so it misses the disabled case. Please copy/apply the listener option state for the accepted socket and cover both enabled and disabled listener cases, including option changes after listen if supported. The existing independentSO_OOBINLINEboolean is also not copied insceNetAccept. Hosted eligibility, conventions, intake, labels and report checks pass; platform build jobs were skipped by path policy. I did not run a local build.Imported from boykopovar/AnyPS5. Originally posted by Queuse on 2026-10-22T01:28:07Z.
@MarcZX10 thanks for catching the test gap. You're right that the loop ends with the listener option enabled, so it doesn't cover accepting with the option disabled or toggling it after
listen.I couldn't reproduce the inheritance failure on Windows. For TCP,
sceNetGetsockoptreadsSO_OOBINLINEfrom the native socket; the cachedoobInlinefield is only read for non-stream sockets.sceNetAcceptuses nativeaccept, which inherits the listener's socket properties.A standalone Winsock check passed all eight IPv4/IPv6 combinations: enabled/disabled before
listen, both toggle directions afterlisten, and isolation from later listener changes. That's a host check, not a new guest-test or Linux run.The guest regression still needs those missing cases. I'd like to pin them there before adding an explicit option copy to
sceNetAccept, since the current TCP path already gets the inherited state from the native socket.Imported from boykopovar/AnyPS5. Originally posted by Queuse on 2026-10-22T01:35:50Z.
@MarcZX10 added the missing guest-test coverage in
6dbde36e7d.All eight IPv4/IPv6 scenarios pass: enabled/disabled before
listen, both toggle directions afterlisten, and listener/accepted-socket isolation in both directions. The existing realMSG_OOBreceive check still passes. Rebuilt libSceNet and the test on Windows 11, GCC 15.2.0 UCRT, Release;guest_net_oob_inlinepasses 1/1 in 0.23 s.Forcing the accepted native option always on passes the old fixture but fails the expanded test. Forcing it always off also fails the expanded test; restoring the implementation passes. No production-code change or explicit copy in
sceNetAcceptwas needed. Linux is still untested.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T01:40:50Z.
Review: DISMISSED
Thanks for adding the missing inheritance coverage. I reviewed the new head: it now tests IPv4 and IPv6 listeners with OOBINLINE enabled and disabled before listen, changes in both directions after listen, and isolation between listener, accepted socket and client. Your PR description reports the focused Windows test passing, and the current conventions/eligibility/labels/report checks pass. The product and relinker jobs were skipped; I did not run a local build.
One integration item remains before approval. I reran
python3 tools/pr_overlap.py --branch refs/remotes/review/pr9543 --repo boykopovar/AnyPS5. It confirms the declared #9525 dependency and lists #6044 among shared files it could not compare because that branch conflicts with base. I manually checked #6044: it relocates networking tests and changes their registrations in this samelibSceNet/CMakeLists.txtfromadd_testtoadd_library_test(networking ...). This PR adds another test there using the old path and registration pattern. Please coordinate with @TaymKal on which PR should land first, then update this branch/itsDepends onentry as needed so the new OOB test is preserved in the networking test reorganization. The existing #9525 dependency should remain. Once this is resolved, I can reassess; I found no remaining issue with the accepted-socket inheritance behavior itself.Imported from boykopovar/AnyPS5. Originally posted by Queuse on 2026-10-22T01:45:58Z.
@MarcZX10 thanks for checking the expanded test. I've proposed the landing order to @TaymKal on #6044, covering both this OOB test and #9542's boolean-readback test.
For this PR, the proposal is #9525 → #9543 → #6044. If the reorganization needs to land first, I'll instead adapt the test path and registration here, retain #9525, add #6044 to
Depends on, and rerun the focused test. The order is still awaiting confirmation.Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-22T04:36:08Z.
Review: COMMENTED
Linux run, since the description lists only Windows 11. The accept-inheritance cases depend on what the host's
acceptcopies, so I checked them on a Linux host too.Machine: Linux x86_64, i7-8700, Ubuntu 26.04 (kernel 7.0.0-38), GCC 15.2, Release,
BUILD_TESTING=ON. Head6dbde36e7merged--no-commitontomainab347d144(clean).guest_net_oob_inlinepasses, 3 of 3 runs: all eight IPv4/IPv6 inheritance scenarios and the realMSG_OOBreceive (A!B). The 20 other libSceNet tests (guest_sce_net,net_dontwait_*,net_blocking_send,net_epoll_lifetime_*) pass with it.main'sExport.cppand this test, it aborts at line 56, the firstsceNetSetsockopt(listener, SOL_SOCKET, 0x100, ...).accepted socket readsSO_OOBINLINEback as the listener had it before the connection (0→0, 1→1), andA, urgent!,Barrive asABwithout the option andA!Bwith it. So on Linux the inheritance comes from the host socket as well, the same way the PR relies on it on Windows, and the stream-socket getter that reads the native option gives the FreeBSDsonewconnresult here too.Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T11:46:48Z.
Current-head recheck: conventions/diff-check pass and the branch merges cleanly with current
main; sync is 2 ahead / 116 behind (94fbb8ceabase). The branch contains the added IPv4/IPv6 listener/accepted-socket cases, with Windows 1/1 and Linux focused results reported in the PR history. The proposed #9525 → #9543 → #6044 test-reorganization order is documented but still awaiting #6044’s author confirmation. Please close that loop, refresh onto currentmain, and rerun the focused tests before merge.Imported from boykopovar/AnyPS5. Originally posted by Queuse on 2026-10-22T15:37:36Z.
@MarcZX10 refreshed this branch onto main
b7d1d47a5(head2034dfe9b3). Conventions and whitespace checks pass, and the description separates earlier runtime results from the refreshed revision. The #9525 before #9543 order remains. I followed up with the authors of #6044 and #5836 and marked their ordering pending; I will not treat either proposal as agreed before they reply.