test(net): skip IPv6 checks when host loopback is unavailable #2894

Merged
MarcZX10 merged 2 commits from upstream-pr/2894 into main 2026-10-11 05:50:58 +00:00
MarcZX10 commented 2026-10-10 17:50:44 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-10T17:50:44Z.


What

Handle the reported Linux test failure when IPv6 sockets can be created but the host has no usable ::1 route. If the guest UDP send to ::1 fails with NET_ENETUNREACH, probe the host with a native UDP send to [::1]:9; skip the IPv6 socket checks only when that native probe also reports IPv6 unavailable. When the host probe succeeds, the guest send is still required to succeed.

This is based on eliyarson's reproduction and initial skip proposal in issue #2820. The host probe addresses the false-skip case identified in the issue discussion. IPv6 text conversion and the IPv4 socket checks still run when the IPv6 socket checks are skipped.

Tested

Linux x86-64, GCC 12.2, Release, rebased onto current main (961b25fe), head 3d79d426: built guest_sce_net_tests; guest_sce_net passed 3/3 with --repeat until-fail:3. This host has IPv6 enabled and ::1 configured, so the normal IPv6 path ran. The unavailable-IPv6 host path was not available locally; eliyarson's report documents that failing setup and errno. Conventions and git diff --check pass.

Windows 11 Pro 26220, WinLibs MinGW-w64 GCC 15.2.0 r7, Release: the prior head c526393b compiled with the IPv6 declarations and guest_sce_net, guest_tcp, guest_udp, guest_socket_pair, and guest_socket_read_write passed 3/3. That host had IPv6 and ::1 available, so the normal IPv6 path ran. This independent Windows result predates the current-main rebase; the source change itself is unchanged.

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 in TechnicalDebt
  • 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
  • AI-assisted: yes

Fixes #2820

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4813259369 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2894). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-10T17:50:44Z. --- ### What Handle the reported Linux test failure when IPv6 sockets can be created but the host has no usable `::1` route. If the guest UDP send to `::1` fails with `NET_ENETUNREACH`, probe the host with a native UDP send to `[::1]:9`; skip the IPv6 socket checks only when that native probe also reports IPv6 unavailable. When the host probe succeeds, the guest send is still required to succeed. This is based on eliyarson's reproduction and initial skip proposal in [issue #2820](https://github.com/boykopovar/AnyPS5/issues/2820). The host probe addresses the false-skip case identified in the issue discussion. IPv6 text conversion and the IPv4 socket checks still run when the IPv6 socket checks are skipped. ### Tested Linux x86-64, GCC 12.2, Release, rebased onto current `main` (`961b25fe`), head `3d79d426`: built `guest_sce_net_tests`; `guest_sce_net` passed 3/3 with `--repeat until-fail:3`. This host has IPv6 enabled and `::1` configured, so the normal IPv6 path ran. The unavailable-IPv6 host path was not available locally; eliyarson's report documents that failing setup and errno. Conventions and `git diff --check` pass. Windows 11 Pro 26220, WinLibs MinGW-w64 GCC 15.2.0 r7, Release: the prior head `c526393b` compiled with the IPv6 declarations and `guest_sce_net`, `guest_tcp`, `guest_udp`, `guest_socket_pair`, and `guest_socket_read_write` passed 3/3. That host had IPv6 and `::1` available, so the normal IPv6 path ran. This independent Windows result predates the current-main rebase; the source change itself is unchanged. ### 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](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [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 - [x] AI-assisted: yes Fixes #2820
oneandonlydean commented 2026-10-10 19:18:14 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-10T19:18:14Z.


The manual build fails to compile on Windows: GuestSceNet.cpp:236: 'sockaddr_in6' was not declared in this scope (also in6addr_loopback), https://github.com/boykopovar/AnyPS5/actions/runs/38074518482. It probably needs <ws2tcpip.h> on Windows.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6101237779 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2894#issuecomment-6101237779). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-10T19:18:14Z. --- The manual build fails to compile on Windows: `GuestSceNet.cpp:236: 'sockaddr_in6' was not declared in this scope` (also `in6addr_loopback`), https://github.com/boykopovar/AnyPS5/actions/runs/38074518482. It probably needs `<ws2tcpip.h>` on Windows.
MarcZX10 commented 2026-10-10 20:14:46 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-10T20:14:46Z.


Thanks for catching the missing Windows declarations. I added <ws2tcpip.h> after <winsock2.h> so sockaddr_in6 and in6addr_loopback are declared on Windows.

After rebasing onto current main, I rebuilt guest_sce_net_tests on Linux and ran guest_sce_net three times; all three runs passed. Windows compilation is pending CI.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6101739281 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2894#issuecomment-6101739281). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-10T20:14:46Z. --- Thanks for catching the missing Windows declarations. I added `<ws2tcpip.h>` after `<winsock2.h>` so `sockaddr_in6` and `in6addr_loopback` are declared on Windows. After rebasing onto current `main`, I rebuilt `guest_sce_net_tests` on Linux and ran `guest_sce_net` three times; all three runs passed. Windows compilation is pending CI.
screamm commented 2026-10-10 21:01:36 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by screamm on 2026-10-10T21:01:36Z.


Windows validation of the current head c526393b (already on main 56fb1b3b).

Windows 11 Pro 26220, WinLibs MinGW-w64 GCC 15.2.0 r7, Ninja, Release, BUILD_TESTING=ON, full build including the libs target. This host has IPv6 and ::1 available, so the normal IPv6 path ran, not the skip path.

  • guest_sce_net, guest_tcp, guest_udp, guest_socket_pair and guest_socket_read_write pass 3/3 (--repeat until-fail:3).
  • ctest -j8 -E "^agc_|video_out" passes 388/388.

Validation run with Claude Code assistance.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6102135321 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2894#issuecomment-6102135321). Originally posted by [screamm](https://github.com/screamm) on 2026-10-10T21:01:36Z. --- Windows validation of the current head `c526393b` (already on `main` `56fb1b3b`). Windows 11 Pro 26220, WinLibs MinGW-w64 GCC 15.2.0 r7, Ninja, Release, `BUILD_TESTING=ON`, full build including the `libs` target. This host has IPv6 and `::1` available, so the normal IPv6 path ran, not the skip path. - `guest_sce_net`, `guest_tcp`, `guest_udp`, `guest_socket_pair` and `guest_socket_read_write` pass 3/3 (`--repeat until-fail:3`). - `ctest -j8 -E "^agc_|video_out"` passes 388/388. Validation run with Claude Code assistance.
MarcZX10 commented 2026-10-11 03:50:42 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-11T03:50:42Z.


I rebased this PR onto current main (961b25fe) after finding it had fallen behind by 265 commits. The rebase was clean. On the rebased head, the Release guest_sce_net test passes 3/3 on Linux GCC 12.2; conventions and diff checks also pass. I updated the Tested section to separate this current-head run from the earlier independent Windows run.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6105175019 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2894#issuecomment-6105175019). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-11T03:50:42Z. --- I rebased this PR onto current `main` (`961b25fe`) after finding it had fallen behind by 265 commits. The rebase was clean. On the rebased head, the Release `guest_sce_net` test passes 3/3 on Linux GCC 12.2; conventions and diff checks also pass. I updated the Tested section to separate this current-head run from the earlier independent Windows run.
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!2894
No description provided.