feat(libSceNet): read reuse and broadcast flags #9542
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/9542"
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:08:17Z.
What
Read
SO_REUSEADDRandSO_BROADCASTfrom the native socket insceNetGetsockopt, returning the FreeBSD flag bits (4and32) and truncating output to the supplied length. Semantics follow FreeBSD 11.4 sogetopt/sooptcopyout; console results remain unverified in library debt.Merge after #9523 because both edit the getter length-validation hunk.
Tested
Windows 11 x86-64, WinLibs MinGW-w64 GCC 15.2.0-r7, Ninja, Release. Head
ec47c9aa87includes mainb4d8e8bb3b.guest_net_boolean_readback,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 #10097. 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:12:28Z.
Review: CHANGES_REQUESTED
The new readback branch and tests are focused, the Windows test results are reported, and the current eligibility, conventions, intake, labels and report checks pass; product jobs are skipped. I found no defect in the option mapping or short-buffer handling.
Please complete the overlap ordering before merge. #9525 also changes
sceNetGetsockoptinExport.cppand the libSceNet test-registration area; a directgit merge-treeof the two heads is clean, and their option cases appear separable, but the repository overlap rule still calls for recording which PR lands first. Since both PRs are yours, please add #9525 to the overlap/order note and toDepends onif #9542 should follow it, or record the agreed order if #9542 lands first. Keep the already-declared #9523 prerequisite for the getter-length hunk.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T01:13:52Z.
Review: COMMENTED
Correction to my preceding review: the live branch overlap report lists #9523 at the
sceNetGetsockoptlength-validation lines, which this PR already declares, but does not list #9525. A direct merge-tree of #9542 and #9525 is clean; I withdraw the requested ordering change for #9525.I found a separate unresolved overlap with #6044: it moves the existing
libSceNettests totests/networkingand rewrites their CMake registrations toadd_library_test(networking)in the samelibSceNet/CMakeLists.txttest block where this PR adds a test. A pairwise merge also conflicts in that CMake file. Please coordinate the landing order and recordDepends on: #6044if this PR should follow the reorganization, or note the agreed order and carry the new test registration/path through whichever lands second.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T01:13:54Z.
Review: DISMISSED
The focused option mapping is consistent with the existing setters and FreeBSD flag-bit behavior; the reported Windows test covers enabled/disabled values, native readback, short buffers and invalid arguments. Current eligibility, conventions, intake, labels and report checks pass; product jobs are skipped.
The branch-mode overlap report identifies #9523 at the getter length-validation lines, and this PR correctly declares
Depends on: #9523. The other unresolved manual overlap is #6044: its current diff moves thelibSceNettests totests/networkingand rewrites registrations in the samelibSceNet/CMakeLists.txttest block where this PR addsguest_net_boolean_readback. Pairwise merge-tree reports a conflict in that CMake file. Please coordinate the order and record the dependency if this PR should follow #6044, then ensure the test source path and registration use the final organization.Imported from boykopovar/AnyPS5. Originally posted by Queuse on 2026-10-22T01:27:59Z.
@MarcZX10 thanks for the correction. I'll keep #9523 as the prerequisite; there's no need to add #9525.
I confirmed the CMake conflict with #6044. That branch also conflicts in the same file against main alone, so this is a test-organization conflict rather than a dependency in the socket behavior.
@TaymKal would landing #9523 and this PR before #6044 work for you? The new
GuestNetBooleanReadback.cpptest would then need to move totests/networkingand useadd_library_test(networking)along with the other network tests. If #6044 needs to land first, I can rebase this PR and make those changes here instead. The order is still a proposal until we agree.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T11:46:47Z.
I refreshed this head against the current queue: diff-check and conventions pass, and it merges cleanly with current
main; sync is 1 ahead / 119 behind (a6dcea927base). Your #9523 prerequisite is recorded, and the Linux/Windows focused results are in the PR history. The proposed order with #6044 is still awaiting that author’s confirmation; please close that coordination loop, then update to currentmainand rerun the focused network tests/checks.Imported from boykopovar/AnyPS5. Originally posted by harisibrar1 on 2026-10-22T13:04:39Z.
Review: COMMENTED
Checked against main
3ca07d086dand FreeBSD 11.4sys/kern/uipc_socket.c(sogetopt/sooptcopyout):so_options & optnamedoes. The short-length exemption is limited to these twoSOL_SOCKEToptions, so every other option still getsEINVALbelow 4 bytes and reports*optlen = 4as before. A three-way merge with current main applies cleanly.SO_REUSEADDRis passed to Winsock'sSO_REUSEADDR(setter, Export.cpp around line 1511 on main). On Winsock that lets a second socket bind an address and port another socket is actively using, while FreeBSD only lets the flag reuse a port held in TIME_WAIT and needsSO_REUSEPORTon both sockets for a second unicast bind. The setter on main already does this, but since this PR adds the debt entry for these options, a sentence there would record the gap. Maybe also note thatSO_REUSEPORT(0x200) still fails withEOPNOTSUPP.Reviewed with AI assistance (Claude Code); the checks above were run locally on my machine.