feat(libSceNet): reverse-resolve IPv6 addresses in sceNetResolverStartAton6 #7991

Merged
MarrasFederico merged 1 commit from upstream-pr/7991 into main 2026-10-20 04:50:03 +00:00
MarrasFederico commented 2026-10-19 17:06:39 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarrasFederico on 2026-10-19T17:06:39Z.


What

sceNetResolverStartAton6 threw not implemented, and its debt entry listed the signature as unknown. SharpProspero Socket.cs documents it as the IPv6 counterpart of sceNetResolverStartAton: (rid, addr, hostname, len, timeout, retry, flags), which reverse-resolves the 16-byte address and writes the name into hostname, len being the size of that buffer.

  • sceNetResolverStartAton and sceNetResolverStartAton6 now share one reverse lookup over the host resolver (getnameinfo with NI_NAMEREQD). Aton6 fills a sockaddr_in6 where Aton fills a sockaddr_in; Aton's behaviour is unchanged.
  • Aton6 follows the argument checks, errors and abort handling Aton already has. A null address, a null buffer or a len of 0 or less returns EINVAL, and an unknown resolver EBADF. An address with no name, or a name that does not fit in len bytes, returns RESOLVER_ENODNS (0x804101E1) and leaves the buffer untouched. Abort flag 2 (ATON preservation) fails the next call with EINTR, and sceNetResolverGetError reports each result.
  • Any nonzero flags throw, as in sceNetResolverStartNtoa6, because their meaning is unknown. Timeout and retry are ignored, as in the other resolver calls.
  • The debt entry records what is unverified: whether the console truncates a long name instead of failing, and the meaning of the flags.

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 on lo (unshare -rn), because on this host IPv6 is disabled on lo and the test skips before its resolver checks:
    • ::1 resolves to the same name the host's getnameinfo returns (ip6-localhost here).
    • A buffer of exactly the name's length plus the terminator succeeds and leaves the byte after it untouched; one byte less returns 0x804101E1 without writing.
    • Abort flag 2 fails the next call with 0x80410104 and errno 4 and leaves the buffer untouched; abort flag 1 does not affect it.
    • Null arguments and len 0 return 0x80410116, an unknown resolver returns 0x80410109, and flags 1, 0x10000 and -1 throw.
  • The test fails on main, where the call throws. Copying 4 bytes of the address instead of 16 also makes it fail.
  • tools/check_conventions.py --base origin/main passes. tools/pr_overlap.py finds no conflicting lines. It could not compare #5836, #6044, #7201 and #7332, which conflict with main; none of them changes the resolver functions.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4924538056 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7991). Originally posted by [MarrasFederico](https://github.com/MarrasFederico) on 2026-10-19T17:06:39Z. --- ### What `sceNetResolverStartAton6` threw `not implemented`, and its debt entry listed the signature as unknown. [SharpProspero `Socket.cs`](https://github.com/SvenGDK/SharpProspero/blob/5dfdb4b0b166e83dc9ae275001afb695f12c7174/src/SharpProspero/Interop/Net/Socket.cs#L992-L997) documents it as the IPv6 counterpart of `sceNetResolverStartAton`: `(rid, addr, hostname, len, timeout, retry, flags)`, which reverse-resolves the 16-byte address and writes the name into `hostname`, `len` being the size of that buffer. - `sceNetResolverStartAton` and `sceNetResolverStartAton6` now share one reverse lookup over the host resolver (`getnameinfo` with `NI_NAMEREQD`). `Aton6` fills a `sockaddr_in6` where `Aton` fills a `sockaddr_in`; `Aton`'s behaviour is unchanged. - `Aton6` follows the argument checks, errors and abort handling `Aton` already has. A null address, a null buffer or a `len` of 0 or less returns `EINVAL`, and an unknown resolver `EBADF`. An address with no name, or a name that does not fit in `len` bytes, returns `RESOLVER_ENODNS` (`0x804101E1`) and leaves the buffer untouched. Abort flag 2 (ATON preservation) fails the next call with `EINTR`, and `sceNetResolverGetError` reports each result. - Any nonzero flags throw, as in `sceNetResolverStartNtoa6`, because their meaning is unknown. Timeout and retry are ignored, as in the other resolver calls. - The debt entry records what is unverified: whether the console truncates a long name instead of failing, and the meaning of the flags. ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> 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 on `lo` (`unshare -rn`), because on this host IPv6 is disabled on `lo` and the test skips before its resolver checks: - `::1` resolves to the same name the host's `getnameinfo` returns (`ip6-localhost` here). - A buffer of exactly the name's length plus the terminator succeeds and leaves the byte after it untouched; one byte less returns `0x804101E1` without writing. - Abort flag 2 fails the next call with `0x80410104` and errno 4 and leaves the buffer untouched; abort flag 1 does not affect it. - Null arguments and `len` 0 return `0x80410116`, an unknown resolver returns `0x80410109`, and flags 1, 0x10000 and -1 throw. - The test fails on `main`, where the call throws. Copying 4 bytes of the address instead of 16 also makes it fail. - `tools/check_conventions.py --base origin/main` passes. `tools/pr_overlap.py` finds no conflicting lines. It could not compare #5836, #6044, #7201 and #7332, which conflict with `main`; none of them changes the resolver functions. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none <!-- #PR, or none --> - [x] Fixes: none <!-- issue it closes as Fixes #N, or none --> - [x] Unblocks: none <!-- title ID and Game bring-up discussion, e.g. PPSA01325 #3232, or none --> - [x] GPUs tested: n/a <!-- for AGC, shader recompiler or VideoOut changes: vendor, model, driver and OS of each GPU the GPU tests ran on; otherwise n/a --> - [x] AI-assisted: yes <!-- yes / no -->
github-actions[bot] commented 2026-10-19 17:07:20 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-19T17:07:20Z.


Progress report (7a015c0 → 87bd71d)

📈 System libraries: 79.85% (+0.02%, +1 implemented functions)

✅ 1 implemented
Library Name
libSceNet sceNetResolverStartAton6
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6272769264 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7991#issuecomment-6272769264). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-19T17:07:20Z. --- <!-- progress-report --> ### Progress report (7a015c0 → 87bd71d) 📈 **System libraries**: 79.85% (+0.02%, +1 implemented functions) <details> <summary>✅ 1 implemented</summary> | Library | Name | | - | - | | libSceNet | `sceNetResolverStartAton6` | </details>
github-actions[bot] commented 2026-10-19 17:33:30 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-19T17:33:30Z.


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.

Pull request Shared files not compared
PR 5836 core/libs/prx/libSceNet/Export.cpp
core/libs/tests/GuestSceNet.cpp
docs/dev/debt/libSceNet.md
PR 6044 core/libs/tests/GuestSceNet.cpp
PR 7201 core/libs/prx/libSceNet/Export.cpp
PR 7332 core/libs/prx/libSceNet/Export.cpp
core/libs/tests/GuestSceNet.cpp
PR 7959 core/libs/prx/libSceNet/Export.cpp
core/libs/tests/GuestSceNet.cpp
docs/dev/debt/libSceNet.md
PR 8106 core/libs/prx/libSceNet/Export.cpp
docs/dev/debt/libSceNet.md
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6273266480 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7991#issuecomment-6273266480). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-19T17:33:30Z. --- <!-- pr-overlap --> 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. | Pull request | Shared files not compared | |---|---| | [PR 5836](https://www.github.com/boykopovar/AnyPS5/pull/5836) | `core/libs/prx/libSceNet/Export.cpp`<br>`core/libs/tests/GuestSceNet.cpp`<br>`docs/dev/debt/libSceNet.md` | | [PR 6044](https://www.github.com/boykopovar/AnyPS5/pull/6044) | `core/libs/tests/GuestSceNet.cpp` | | [PR 7201](https://www.github.com/boykopovar/AnyPS5/pull/7201) | `core/libs/prx/libSceNet/Export.cpp` | | [PR 7332](https://www.github.com/boykopovar/AnyPS5/pull/7332) | `core/libs/prx/libSceNet/Export.cpp`<br>`core/libs/tests/GuestSceNet.cpp` | | [PR 7959](https://www.github.com/boykopovar/AnyPS5/pull/7959) | `core/libs/prx/libSceNet/Export.cpp`<br>`core/libs/tests/GuestSceNet.cpp`<br>`docs/dev/debt/libSceNet.md` | | [PR 8106](https://www.github.com/boykopovar/AnyPS5/pull/8106) | `core/libs/prx/libSceNet/Export.cpp`<br>`docs/dev/debt/libSceNet.md` |
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!7991
No description provided.