feat(libSceNet): implement sceNetResolverStartNtoa6 #5411

Merged
ps54all merged 1 commit from upstream-pr/5411 into main 2026-10-13 22:12:27 +00:00
ps54all commented 2026-10-13 19:13:51 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ps54all on 2026-10-13T19:13:51Z.


What

sceNetResolverStartNtoa6 resolves a host name to its first IPv6 address and writes the 16-byte address. It was not exported, so a title that imports it fails to load (unresolved ELF import zl35YNs9jnI from libSceNet.prx).

  • The IPv4 lookup is generalized over the address family (lookup_host); sceNetResolverStartNtoa and the multiple-record variants keep their behaviour and go through it with AF_INET.
  • The IPv6 call uses the same resolver bookkeeping as the IPv4 one: abort preservation (EINTR), sceNetResolverGetError, and the RESOLVER_ENODNS error for a failed lookup. A name without an IPv6 address fails the same way.
  • Timeout and retry are ignored as in sceNetResolverStartNtoa. Nonzero flags throw, since their meaning for this call is not known.
  • The debt entry in docs/dev/debt/libSceNet.md records the assumptions: signature taken from sceNetResolverStartNtoa, no IPv4-mapped fallback, unverified on hardware.

Tested

Windows 11, RTX 3080, WinLibs GCC 15.2.0 r7, Release.

  • guest_sce_net gains checks: ::1 resolves to ::1, a null name returns EINVAL (0x80410116), and an IPv4 literal (no IPv6 address) returns and records RESOLVER_ENODNS (0x804101E1). Without the implementation the test does not link (undefined reference to sceNetResolverStartNtoa6). With it the test passes (exit 0). On this machine the whole test takes about 34 s, because the existing .invalid lookups wait on the local DNS, so it hits its 20 s ctest timeout here both with and without this change.
  • python tools/check_conventions.py --base origin/main and tools/check_test_registration.py pass.
  • Metal Gear Solid 4: Guns of the Patriots, Master Collection Version (PPSA18194, Unity): on main it fails to load on this import. With this change it reaches its title screen ("Press any button", Ver. 1.4.1) and runs at 60 fps for the 240 s run. Starting a game hands off to the second executable (--executable mgs4/mgs4.elf), which then stops on missing libSceCesCs EUC-JP conversions (sceCesUtf8StrToMbcsStr and its family). That is a separate follow-up.

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; 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
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Unblocks: PPSA18194 (no Game bring-up discussion yet)
  • GPUs tested: n/a
  • AI-assisted: yes (Claude Code); the runs are on my machine.

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4848215175 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5411). Originally posted by [ps54all](https://github.com/ps54all) on 2026-10-13T19:13:51Z. --- ### What `sceNetResolverStartNtoa6` resolves a host name to its first IPv6 address and writes the 16-byte address. It was not exported, so a title that imports it fails to load (`unresolved ELF import zl35YNs9jnI from libSceNet.prx`). - The IPv4 lookup is generalized over the address family (`lookup_host`); `sceNetResolverStartNtoa` and the multiple-record variants keep their behaviour and go through it with `AF_INET`. - The IPv6 call uses the same resolver bookkeeping as the IPv4 one: abort preservation (`EINTR`), `sceNetResolverGetError`, and the `RESOLVER_ENODNS` error for a failed lookup. A name without an IPv6 address fails the same way. - Timeout and retry are ignored as in `sceNetResolverStartNtoa`. Nonzero flags throw, since their meaning for this call is not known. - The debt entry in `docs/dev/debt/libSceNet.md` records the assumptions: signature taken from `sceNetResolverStartNtoa`, no IPv4-mapped fallback, unverified on hardware. ### Tested Windows 11, RTX 3080, WinLibs GCC 15.2.0 r7, Release. - `guest_sce_net` gains checks: `::1` resolves to `::1`, a null name returns `EINVAL` (`0x80410116`), and an IPv4 literal (no IPv6 address) returns and records `RESOLVER_ENODNS` (`0x804101E1`). Without the implementation the test does not link (`undefined reference to sceNetResolverStartNtoa6`). With it the test passes (exit 0). On this machine the whole test takes about 34 s, because the existing `.invalid` lookups wait on the local DNS, so it hits its 20 s ctest timeout here both with and without this change. - `python tools/check_conventions.py --base origin/main` and `tools/check_test_registration.py` pass. - Metal Gear Solid 4: Guns of the Patriots, Master Collection Version (PPSA18194, Unity): on `main` it fails to load on this import. With this change it reaches its title screen ("Press any button", Ver. 1.4.1) and runs at 60 fps for the 240 s run. Starting a game hands off to the second executable (`--executable mgs4/mgs4.elf`), which then stops on missing libSceCesCs EUC-JP conversions (`sceCesUtf8StrToMbcsStr` and its family). That is a separate follow-up. ### Checklist - [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 - [x] Unimplemented paths throw; silent stubs are listed under Silent stubs in their library's technical debt file - [x] No notes, investigation `.md` files or images added to the repository - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Unblocks: PPSA18194 (no Game bring-up discussion yet) - [x] GPUs tested: n/a - [x] AI-assisted: yes (Claude Code); the runs are on my machine. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
github-actions[bot] commented 2026-10-13 19:14:34 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-13T19:14:34Z.


Progress report (dacd785 → df32a44)

➖ System libraries: 88.15% (+0.0%, +1 implemented functions)

✅ 1 implemented
Library Name
libSceNet sceNetResolverStartNtoa6
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6153223043 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5411#issuecomment-6153223043). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-13T19:14:34Z. --- <!-- progress-report --> ### Progress report (dacd785 → df32a44) ➖ **System libraries**: 88.15% (+0.0%, +1 implemented functions) <details> <summary>✅ 1 implemented</summary> | Library | Name | | - | - | | libSceNet | `sceNetResolverStartNtoa6` | </details>
github-actions[bot] commented 2026-10-13 19:27:05 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-13T19:27:05Z.


Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
#5004 docs/dev/debt/libSceNet.md L13
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6153448418 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5411#issuecomment-6153448418). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-13T19:27:05Z. --- <!-- pr-overlap --> Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in **Depends on**. | Pull request | Conflicting files (lines on `main`) | Same exports | Same new files | |---|---|---|---| | #5004 | `docs/dev/debt/libSceNet.md` [L13](https://github.com/boykopovar/AnyPS5/blob/bfc10637d400db450531feb2617e1a703ac773f9/docs/dev/debt/libSceNet.md#L13) | | |
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!5411
No description provided.