Repository navigation
feat(libSceNet): receive urgent TCP data inline - #9543
Conversation
MarcZX10
left a comment
There was a problem hiding this comment.
The accepted connection does not inherit the listener’s SO_OOBINLINE state. sceNetAccept constructs a fresh Sock connection with default fields and does not copy this option or set it on the accepted native socket. FreeBSD 11.4 copies head->so_options into the new socket in sonewconn (minus only SO_ACCEPTCONN), so an option set before listen is inherited by accepted sockets. The current test only checks a listener configured before listen, but its expected accepted value is 256 even 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 independent SO_OOBINLINE boolean is also not copied in sceNetAccept. Hosted eligibility, conventions, intake, labels and report checks pass; platform build jobs were skipped by path policy. I did not run a local build.
|
@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 I couldn't reproduce the inheritance failure on Windows. For TCP, A standalone Winsock check passed all eight IPv4/IPv6 combinations: enabled/disabled before The guest regression still needs those missing cases. I'd like to pin them there before adding an explicit option copy to |
|
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
05c4efa to
6dbde36
Compare
|
@MarcZX10 added the missing guest-test coverage in All eight IPv4/IPv6 scenarios pass: enabled/disabled before 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 |
MarcZX10
left a comment
There was a problem hiding this comment.
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 same libSceNet/CMakeLists.txt from add_test to add_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/its Depends on entry 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.
|
@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 |
jotitadev
left a comment
There was a problem hiding this comment.
Linux run, since the description lists only Windows 11. The accept-inheritance cases depend on what the host's accept copies, 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. Head 6dbde36e7 merged --no-commit onto main ab347d144 (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.- Red→green: with
main'sExport.cppand this test, it aborts at line 56, the firstsceNetSetsockopt(listener, SOL_SOCKET, 0x100, ...). - Linux host check, plain sockets on the same box (IPv4 and IPv6 loopback): an
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.
|
Current-head recheck: conventions/diff-check pass and the branch merges cleanly with current |
|
@MarcZX10 refreshed this branch onto main |
|
Refreshed in #9525 before this PR remains the order. #6044 was closed without its test relocation; the separate peer/broadcast coordination with #5836 is still pending. |
8d1b7bc to
6c0bb5a
Compare
Dismissing a stale review: the requested changes were addressed after it (new head) and the merge queue blocks on it. Please request changes again if anything is still open.
|
Rebased onto current |
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)