feat(libSceNet): list IPv6 sockets in sceNetGetSockInfo6 #8362
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/8362"
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 MarrasFederico on 2026-10-20T11:03:12Z.
What
sceNetGetSockInfo6threwnot implemented, and its debt entry listed the signature as unknown. SharpProsperoSocket.csdocumentsSceNetSockInfo6: the 0xA0-byteSceNetSockInfowith its two reserved blocks at 0x6C and 0x7C used for the local and remote IPv6 addresses, and the IPv4 address fields kept for IPv4-only sockets. It also documents theIPV6status flag (0x400000) and the 0x1000 flag that reports both families.The call is the IPv6 counterpart of
sceNetGetSockInfoand follows it for everything else:flagsother than 0x40 (TIME_WAIT) and 0x1000 fail withEINVAL, as do a nullinfowiths >= 0andn < 1; a bad descriptor fails withEBADF.s < 0, a nullinforeturns the count, and otherwise up tonrecords are written in descriptor order.swithout 0x1000 fails withEAFNOSUPPORT, assceNetGetSockInfodoes for an IPv6 socket.SELF,NONBLOCKandIPV6flags. An IPv4 socket is reported with its IPv4 addresses, zero IPv6 addresses and noIPV6flag. The other fields are 0, as insceNetGetSockInfo.The debt entry records that nothing is measured on a console; shadPS4 only stubs the call.
Current overlap follow-up: #9948 changes
sock_buffer_sizefromSocktoSockInfoSource; this PR'sfill_sock_info6still uses the former. I proposed #8362 first, then #9948 with that caller adapted on rebase. This is a proposed order, not a completed combined validation.Tested
Ubuntu 26.04.1, kernel 7.0.0-38, GCC 15.2.0, Release, full build with
BUILD_TESTING=ON. Windows was not compiled. No title was run.guest_sce_net, run in a network namespace with IPv6 onlo(unshare -rn), because IPv6 is disabled onloon this host and the test skips its IPv6 cases there (#7987). In the namespace the whole test passes:n < 1, a nullinfowiths >= 0, and a closed descriptor andINT32_MAXgivingEBADF.EAFNOSUPPORTwithout 0x1000 and a full record with it.::1.nof 1, 2, count + 1 andINT32_MAX, flags 0x40, 0x1000 and 0x1040, and no writes on errors.main, where the call throws. Dropping theIPV6flag, swapping the local and remote addresses, listing IPv4 sockets without 0x1000, or accepting another flag makes it fail.tools/check_conventions.py --base origin/mainpasses.tools/pr_overlap.pyfinds no conflicting lines. It could not compare #5836, #6044, #7201, #7332, #8204 and #8254, which conflict withmain; none of them touches the socket info calls.main524398151f.mainnow declaressceNetGetSockInfo6(std::int32_t, NetSockInfo6*, std::uint32_t capacity, std::uint32_t flags), and the implementation takes that signature. A capacity read as a negativeint32_t(for example -1) still returnsEINVAL. Allguest_sce_netchecks pass again, in a network namespace with IPv6 on loopback.docs/dev/debt/libSceNet.md: thesceNetGetSockInfo6entry now sits after thesceNetSendmsg and sceNetRecvmsgentry, a line no open PR changes. It was right aftersceNetGetSockInfo, where #9544 inserts too.tools/pr_overlap.pynow reports no conflicting lines. Pairwise three-way merges with #9544, #9733, #9727, #9494, #9578, #9525 and #9542 are clean, so no merge order is needed.sceNetSetDnsInfo/sceNetSetDns6Info): no overlap. Merged together ontomain, the two merge cleanly, andguest_sce_netand #9506'sguest_net_dns_infoboth pass. #9506 can land before or after this PR.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 github-actions[bot] on 2026-10-20T11:03:50Z.
Progress report (
8b3e398→d5d453c)📈 System libraries: 43.24% (+0.01%, +1 implemented functions)
✅ 1 implemented
sceNetGetSockInfo6Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-21T06:53:45Z.
@MarrasFederico thanks. The layout and the listing logic match
sceNetGetSockInfo, but the branch no longer builds once merged with currentmain:Since your base,
mainmoved the non-blocking flag fromSockinto the native handle (std::shared_ptr<NativeSocketHandle> native), andsceNetGetSockInfo'sfill_sock_infonow readssocket.native->nonblock. Please rebase ontomainand make the same change infill_sock_info6:(Checked with GCC 13
-fsyntax-onlyon the merge ofa6a3831b7fintomain7ce3b1df3e:mainalone compiles, the merge fails only at that line, andGuestSceNet.cppcompiles.)Imported from boykopovar/AnyPS5. Originally posted by ycbuzi on 2026-10-21T07:35:13Z.
Windows build of
a6a3831b7fmerged onto currentmainb77bd58806(clean merge, 3a504b44fe) fails, the build the description lists as not done. Windows 11 Home 10.0.26200, MinGW-w64 GCC 15.2.0 (ucrt-posix-seh r7), Release,BUILD_TESTING=ON.fill_sock_info6copiessceNetGetSockInfo's record code as it was at this PR's base777bd0f4b2. #8653 (merged 01:19 UTC today) has since removedbool nonblockfromSockand moved the flag tostd::atomic<bool> nonblockinNativeSocketHandle; its edit to the IPv4 copy merges without a conflict, so after the mergesceNetGetSockInforeadssocket.native->nonblock(line 1576) while the IPv6 copy still readssocket.nonblock. The line is not under_WIN32andSockhas nononblockon any host now, so I expect the same error on Linux after a rebase; I only built Windows. This PR's last checks ran before #8653 landed, with the build jobs skipped.With this one line changed on the merge,
libSceNetandguest_sce_net_testsbuild with no warnings, andctest --repeat until-fail:2onguest_sce_netpasses on both repeats. Its new nonblocking datagram case expects the0x200000flag, so it exercises this read.Not run: Linux, a title.
Imported from boykopovar/AnyPS5. Originally posted by MarrasFederico on 2026-10-21T12:33:20Z.
@oneandonlydean thanks, fixed in
c4a2fbf79after merging currentmain:fill_sock_info6now readssocket.native->nonblock, asfill_sock_infodoes. It builds, andguest_sce_netpasses, including the IPv6 cases in a network namespace with IPv6 onlo.@ycbuzi that was the same line your Windows build stopped on.
Imported from boykopovar/AnyPS5. Originally posted by harmsluis on 2026-10-21T16:45:21Z.
Windows run of the fix (
c4a2fbf79) merged ontomaincecb540a6without conflicts. Windows 11 build 26300, non-elevated, WinLibs MinGW-w64 GCC 15.2.0 r7, Ninja, Release,BUILD_TESTING=ON.guest_sce_netbuilds with no new warnings and passes 5/5 (ctest --repeat until-fail:3and two more runs).CheckSockInfo6is called from the test, sosceNetGetSockInfo6ran.socket.nonblock: the build stops atExport.cpp:1639with'struct {anonymous}::Sock' has no member named 'nonblock', the same error as the earlier Windows build ofa6a3831b7.Not covered: the full build, and any title run.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T02:07:09Z.
I am reviewing #9506, which adds
sceNetSetDnsInfo,sceNetSetDns6InfoandsceNetGetDns6Infoplus a new registered test and debt entry. The overlap bot could not compare some of these branches because of base conflicts, and this PR author has not yet recorded an agreed merge order. Please confirm whether your current changes overlap these exact exports, CMake/test insertion, or debt section, and whether #9506 can land before your PR or should depend on yours. The #9506 author is being asked to record the agreed order inDepends onand the overlap note.Imported from boykopovar/AnyPS5. Originally posted by MarrasFederico on 2026-10-22T04:59:31Z.
@MarcZX10 no overlap with #9506. I checked the exact exports, the CMake/test registration and the debt section:
sceNetGetSockInfo6and itsfill_sock_info6helper. #9506 touchessceNetSetDnsInfo,sceNetSetDns6InfoandsceNetGetDns6Info.guest_sce_net, while #9506 registers a newguest_net_dns_info.libSceNet.md.I updated this branch to
main524398151f, wheresceNetGetSockInfo6now has a declared signature, and the implementation takes it.Merged together onto that
main, the two branches merge cleanly.guest_sce_netandguest_net_dns_infoboth pass, in a network namespace with IPv6 on loopback. #9506 can land before or after this PR; neither needs to depend on the other. I added this to the description.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T11:33:19Z.
I compared your current branch with open #9544. The implementations/tests are independent, but both branches add a debt entry at the same insertion point in
docs/dev/debt/libSceNet.md, and their pairwise three-way merge currently conflicts in that file. Please coordinate the merge order with #9544’s author and update the overlap note /Depends onif one PR must land first. #9544 individually merges cleanly with currentmain; the conflict is between the two PR branches.Imported from boykopovar/AnyPS5. Originally posted by MarrasFederico on 2026-10-22T12:38:30Z.
@MarcZX10 thanks. I moved the
sceNetGetSockInfo6debt entry instead of ordering the two PRs. It now sits after thesceNetSendmsg and sceNetRecvmsgentry, a line that no open PR edits; before, both this PR and #9544 inserted right aftersceNetGetSockInfo.With the current head:
tools/pr_overlap.pyreports no conflicting lines.No
Depends onis needed either way. I updated the overlap note in the description.Imported from boykopovar/AnyPS5. Originally posted by harisibrar1 on 2026-10-24T13:51:06Z.
Review: APPROVED
Checked against main
522e32e3b6and SharpProsperoSocket.cs(5dfdb4b):merge-tree, no conflicts), and main still throws insceNetGetSockInfo6, so this isn't duplicated.fill_sock_info6matches main'sfill_sock_info(thenative->nonblockread, the WinsockWSAEINVALhandling for an unbound socket,ENOTCONNfromgetpeername). BecauseIPV6_V6ONLYis set at socket creation, no v4-mapped addresses reach the IPv6 branch.NetSockInfo6definition completes main's global-scope forward declaration, and thestatic_asserts pin 0x6C/0x7C and the fields shared withNetSockInfo.Reviewed with AI assistance (Claude Code); the checks above were run locally on my machine.