feat(libSceNetCtl): support NET_CTL_INFO_HTTP_PROXY_PORT and validate null in sceNetCtlGetNatInfo #7237

Merged
ErenYeager1836 merged 1 commit from upstream-pr/7237 into main 2026-10-17 21:13:57 +00:00
ErenYeager1836 commented 2026-10-17 18:37:20 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ErenYeager1836 on 2026-10-17T18:37:20Z.


What

This PR provides two improvements to libSceNetCtl:

  1. In sceNetCtlGetInfo, NET_CTL_INFO_HTTP_PROXY_PORT (code 21) was already permitted within the valid code range check (code <= NET_CTL_INFO_HTTP_PROXY_PORT), but was unhandled in the switch (code) statement, falling through to throw a runtime error. Since HTTP proxy configuration is reported as disabled (NET_CTL_HTTP_PROXY_OFF), proxy port is now handled by returning 0, matching the disabled proxy state.
  2. In sceNetCtlGetNatInfo, null pointer verification is added to return SCE_NET_CTL_ERROR_INVALID_ADDR (0x80412107) when nat_info is null.

Guest test GuestNetCtl is updated to verify that:

  • QueryWord(21) returns 0.
  • Unhandled codes {5, 6, 7, 8, 9, 10} throw runtime errors while 21 succeeds.
  • sceNetCtlGetNatInfo(nullptr) returns SCE_NET_CTL_ERROR_INVALID_ADDR.
  • sceNetCtlGetNatInfo(&nat_info) returns SCE_NET_CTL_ERROR_NOT_CONNECTED.

Tested

  • Guest test GuestNetCtl extended with proxy port and NAT info validation assertions.
  • python tools/check_conventions.py --base upstream/main passes with no violations.
  • git diff --check clean.

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:4902856522 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7237). Originally posted by [ErenYeager1836](https://github.com/ErenYeager1836) on 2026-10-17T18:37:20Z. --- ### What This PR provides two improvements to `libSceNetCtl`: 1. In `sceNetCtlGetInfo`, `NET_CTL_INFO_HTTP_PROXY_PORT` (code 21) was already permitted within the valid code range check (`code <= NET_CTL_INFO_HTTP_PROXY_PORT`), but was unhandled in the `switch (code)` statement, falling through to throw a runtime error. Since HTTP proxy configuration is reported as disabled (`NET_CTL_HTTP_PROXY_OFF`), proxy port is now handled by returning `0`, matching the disabled proxy state. 2. In `sceNetCtlGetNatInfo`, null pointer verification is added to return `SCE_NET_CTL_ERROR_INVALID_ADDR` (`0x80412107`) when `nat_info` is null. Guest test `GuestNetCtl` is updated to verify that: - `QueryWord(21)` returns `0`. - Unhandled codes `{5, 6, 7, 8, 9, 10}` throw runtime errors while 21 succeeds. - `sceNetCtlGetNatInfo(nullptr)` returns `SCE_NET_CTL_ERROR_INVALID_ADDR`. - `sceNetCtlGetNatInfo(&nat_info)` returns `SCE_NET_CTL_ERROR_NOT_CONNECTED`. ### Tested - Guest test `GuestNetCtl` extended with proxy port and NAT info validation assertions. - `python tools/check_conventions.py --base upstream/main` passes with no violations. - `git diff --check` clean. ### 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 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 - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-17 19:08:03 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-17T19:08:03Z.


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
PR 6685 docs/dev/debt/libSceNetCtl.md L5
PR 6720 core/libs/prx/libSceNetCtl/Export.cpp L354
core/libs/tests/GuestNetCtl.cpp L132-140
docs/dev/debt/libSceNetCtl.md L5

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 6039 docs/dev/debt/libSceNetCtl.md
PR 6044 core/libs/tests/GuestNetCtl.cpp
PR 6138 core/libs/prx/libSceNetCtl/Export.cpp
core/libs/tests/GuestNetCtl.cpp
docs/dev/debt/libSceNetCtl.md
PR 7201 core/libs/prx/libSceNetCtl/Export.cpp
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6239232931 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7237#issuecomment-6239232931). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-17T19:08:03Z. --- <!-- 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 | |---|---|---|---| | [PR 6685](https://www.github.com/boykopovar/AnyPS5/pull/6685) | `docs/dev/debt/libSceNetCtl.md` [L5](https://github.com/boykopovar/AnyPS5/blob/821fc29537004ae1249eec1e47ecd2ceb0c22351/docs/dev/debt/libSceNetCtl.md#L5) | | | | [PR 6720](https://www.github.com/boykopovar/AnyPS5/pull/6720) | `core/libs/prx/libSceNetCtl/Export.cpp` [L354](https://github.com/boykopovar/AnyPS5/blob/821fc29537004ae1249eec1e47ecd2ceb0c22351/core/libs/prx/libSceNetCtl/Export.cpp#L354)<br>`core/libs/tests/GuestNetCtl.cpp` [L132-140](https://github.com/boykopovar/AnyPS5/blob/821fc29537004ae1249eec1e47ecd2ceb0c22351/core/libs/tests/GuestNetCtl.cpp#L132-L140)<br>`docs/dev/debt/libSceNetCtl.md` [L5](https://github.com/boykopovar/AnyPS5/blob/821fc29537004ae1249eec1e47ecd2ceb0c22351/docs/dev/debt/libSceNetCtl.md#L5) | | | 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 6039](https://www.github.com/boykopovar/AnyPS5/pull/6039) | `docs/dev/debt/libSceNetCtl.md` | | [PR 6044](https://www.github.com/boykopovar/AnyPS5/pull/6044) | `core/libs/tests/GuestNetCtl.cpp` | | [PR 6138](https://www.github.com/boykopovar/AnyPS5/pull/6138) | `core/libs/prx/libSceNetCtl/Export.cpp`<br>`core/libs/tests/GuestNetCtl.cpp`<br>`docs/dev/debt/libSceNetCtl.md` | | [PR 7201](https://www.github.com/boykopovar/AnyPS5/pull/7201) | `core/libs/prx/libSceNetCtl/Export.cpp` |
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!7237
No description provided.