feat(net): parse Ethernet address strings #8204

Merged
realshinmalphur merged 8 commits from upstream-pr/8204 into main 2026-10-22 03:47:14 +00:00
realshinmalphur commented 2026-10-20 02:50:45 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by realshinmalphur on 2026-10-20T02:50:45Z.


What

Implement sceNetEtherStrton(const char*, NetEtherAddr*), replacing the throwing placeholder added by #8106. Updated after @orezraey's PS5 firmware 13.60 probe and log and @oneandonlydean's review:

  • Decode fixed pairs at offsets 0–1, 3–4, 6–7, 9–10, 12–13 and 15–16. Ignore separator characters and trailing text. ASCII letters beyond f keep their alphabetic values, and pair arithmetic truncates to eight bits.
  • Null arguments return guest EINVAL (0x80410116, errno 22). Successful calls preserve guest errno and write exactly six bytes.
  • Deliberate safety difference: a NUL within the first 17 bytes returns EINVAL without changing the destination. Do not reproduce the console's reads beyond the terminating NUL. This includes short single-digit-group inputs.
  • Non-ASCII digit bytes throw because their decoding is unmeasured. Non-ASCII separator bytes are ignored. Remaining gaps are recorded in the existing debt entry.

The original behavioral reference was the strict shadPS4 parser at d615b388, lines 1274–1297; the PS5 measurements supersede that validation behavior. The PS5 3.20 inventory confirms the export name and NID b-bFZvNV59I.

Current main already declares this export, so this adds an implementation, not a new declared export. Previous attempt #6250 is closed/unmerged. No title-unblock or performance claim. Main was integrated through GitHub's conflict-resolution merge, not a history-rewriting rebase; the duplicate placeholder and its obsolete debt bullet are removed.

Overlap coordination (2026-10-22): compared #9506 at bed7b5c2e with this PR updated on main 6ef5a1c4c. No shared export implementation or CMake/test insertion: this PR changes only sceNetEtherStrton, adds CheckEtherAddress to existing GuestSceNet, and replaces its debt entry. #9506 changes DNS state/getters/setters, adds GuestNetDnsInfo and its CMake registration, and changes separate DNS debt entries. A pairwise merge auto-merges Export.cpp; the only textual conflict is adjacent Ether/DNS debt lines. From this PR author's side, #9506 may land first without depending on #8204; retain both entries and resolve that textual conflict whichever lands second. No functional dependency, so Depends on: none. This is our author-side consent, not a claim that #9506's author has already confirmed a bilateral order or resolved its other overlaps.

Tested

Linux 7.2.9-2-cachyos, GCC 16.2.1 and Clang 23.1.3. Main integration tested against d34da5d69:

  • Built the actual complete libc, libkernel, libSceNet and libSceNetCtl shared targets using an external isolated CMake harness with repository-pinned ZArchive/zstd sources. This is not a full-project build. The external focused harness was updated to link libSceNetCtl after main's test additions.
  • Full current GuestSceNet executable and focused parser tests each pass ten consecutive runs: 2/2 tests, 12.03 seconds total.
  • Tests cover 256 six-octet round trips, mixed case, arbitrary separators, ignored trailing text, all ASCII letters/digits plus measured punctuation in both pair positions, eight-bit truncation, all short prefix lengths, embedded NUL at every position, an exactly 17-byte non-terminated input, null arguments, errno preservation, unchanged output on errors and adjacent output guards. Non-ASCII digit bytes throw without modifying output; non-ASCII separators are ignored.
  • The updated regression tests fail against the previously published strict implementation (exit 134), before rebuilding the libraries.
  • Actual Export.cpp and focused tests pass Clang AddressSanitizer and UndefinedBehaviorSanitizer, linked to GCC-built dependencies (the dependencies are not sanitizer-instrumented).
  • Conventions and whitespace checks pass. Published file contents are verified against the tested local tree.

Console measurements belong to @orezraey; I have no PS5 and did not independently reproduce them. No full-project build, Windows test or title execution was performed. Please run the collaborator-triggered full Linux/Windows Build workflow before merge. The overlap tool's GitHub step requires local gh authentication, which is unavailable; the automatic overlap check remains needed.

2026-10-22 refresh: integrated main 6ef5a1c4c, retaining its new debt entries and keeping only the updated EtherStrton entry. Parser implementation and behavioral tests are unchanged. Rebuilt the same actual library targets and reran the current complete GuestSceNet executable and focused parser test three times each: 2/2 pass, 3.60 seconds total. Conventions and whitespace checks pass. This was not a combined runtime test of #9506. @lost9409 separately reports one Windows 11 focused guest_sce_net pass in 1.42 seconds, applying our earlier f923ebb files to base a6dcea9 with unrelated fixes #8310/#9056; that is contributor-provided evidence, not our own Windows/full-suite run.

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 (Codex)
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4930297780 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8204). Originally posted by [realshinmalphur](https://github.com/realshinmalphur) on 2026-10-20T02:50:45Z. --- ### What Implement `sceNetEtherStrton(const char*, NetEtherAddr*)`, replacing the throwing placeholder added by #8106. Updated after @orezraey's [PS5 firmware 13.60 probe and log](https://gist.github.com/orezraey/789290577123af3c45b340d6db6f395c/71e0a6215c7ee86f49fdb31de989dd2b50720b7a) and @oneandonlydean's review: - Decode fixed pairs at offsets 0–1, 3–4, 6–7, 9–10, 12–13 and 15–16. Ignore separator characters and trailing text. ASCII letters beyond f keep their alphabetic values, and pair arithmetic truncates to eight bits. - Null arguments return guest `EINVAL` (`0x80410116`, errno 22). Successful calls preserve guest errno and write exactly six bytes. - Deliberate safety difference: a NUL within the first 17 bytes returns `EINVAL` without changing the destination. Do not reproduce the console's reads beyond the terminating NUL. This includes short single-digit-group inputs. - Non-ASCII digit bytes throw because their decoding is unmeasured. Non-ASCII separator bytes are ignored. Remaining gaps are recorded in the existing debt entry. The original behavioral reference was the strict [shadPS4 parser at d615b388, lines 1274–1297](https://github.com/shadps4-emu/shadPS4/blob/d615b3887ba29025a59242e1a26f5b68bb176158/src/core/libraries/net/net.cpp#L1274-L1297); the PS5 measurements supersede that validation behavior. The [PS5 3.20 inventory](https://github.com/DNNDHH/PS5-3.20_Libs/blob/b2a77c09cd71c01f34c790cfbe98c751a13262ad/libSceNet.c) confirms the export name and NID `b-bFZvNV59I`. Current main already declares this export, so this adds an implementation, not a new declared export. Previous attempt #6250 is closed/unmerged. No title-unblock or performance claim. Main was integrated through GitHub's conflict-resolution merge, not a history-rewriting rebase; the duplicate placeholder and its obsolete debt bullet are removed. Overlap coordination (2026-10-22): compared #9506 at `bed7b5c2e` with this PR updated on main `6ef5a1c4c`. No shared export implementation or CMake/test insertion: this PR changes only `sceNetEtherStrton`, adds `CheckEtherAddress` to existing GuestSceNet, and replaces its debt entry. #9506 changes DNS state/getters/setters, adds GuestNetDnsInfo and its CMake registration, and changes separate DNS debt entries. A pairwise merge auto-merges Export.cpp; the only textual conflict is adjacent Ether/DNS debt lines. From this PR author's side, #9506 may land first without depending on #8204; retain both entries and resolve that textual conflict whichever lands second. No functional dependency, so `Depends on: none`. This is our author-side consent, not a claim that #9506's author has already confirmed a bilateral order or resolved its other overlaps. ### 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. --> Linux 7.2.9-2-cachyos, GCC 16.2.1 and Clang 23.1.3. Main integration tested against `d34da5d69`: - Built the actual complete libc, libkernel, libSceNet and libSceNetCtl shared targets using an external isolated CMake harness with repository-pinned ZArchive/zstd sources. This is not a full-project build. The external focused harness was updated to link libSceNetCtl after main's test additions. - Full current GuestSceNet executable and focused parser tests each pass ten consecutive runs: 2/2 tests, 12.03 seconds total. - Tests cover 256 six-octet round trips, mixed case, arbitrary separators, ignored trailing text, all ASCII letters/digits plus measured punctuation in both pair positions, eight-bit truncation, all short prefix lengths, embedded NUL at every position, an exactly 17-byte non-terminated input, null arguments, errno preservation, unchanged output on errors and adjacent output guards. Non-ASCII digit bytes throw without modifying output; non-ASCII separators are ignored. - The updated regression tests fail against the previously published strict implementation (exit 134), before rebuilding the libraries. - Actual Export.cpp and focused tests pass Clang AddressSanitizer and UndefinedBehaviorSanitizer, linked to GCC-built dependencies (the dependencies are not sanitizer-instrumented). - Conventions and whitespace checks pass. Published file contents are verified against the tested local tree. Console measurements belong to @orezraey; I have no PS5 and did not independently reproduce them. No full-project build, Windows test or title execution was performed. Please run the collaborator-triggered full Linux/Windows Build workflow before merge. The overlap tool's GitHub step requires local gh authentication, which is unavailable; the automatic overlap check remains needed. 2026-10-22 refresh: integrated main `6ef5a1c4c`, retaining its new debt entries and keeping only the updated EtherStrton entry. Parser implementation and behavioral tests are unchanged. Rebuilt the same actual library targets and reran the current complete GuestSceNet executable and focused parser test three times each: 2/2 pass, 3.60 seconds total. Conventions and whitespace checks pass. This was not a combined runtime test of #9506. @lost9409 separately [reports one Windows 11 focused guest_sce_net pass in 1.42 seconds](https://github.com/boykopovar/AnyPS5/pull/8204#issuecomment-6328991655), applying our earlier `f923ebb` files to base `a6dcea9` with unrelated fixes #8310/#9056; that is contributor-provided evidence, not our own Windows/full-suite run. ### 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 - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes (Codex)
github-actions[bot] commented 2026-10-20 03:03:45 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-20T03:03:45Z.


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 9506 docs/dev/debt/libSceNet.md L15-16

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 6879 core/libs/prx/libSceNet/Export.cpp
PR 7201 core/libs/prx/libSceNet/Export.cpp
PR 8225 core/libs/prx/libSceNet/Export.cpp
core/libs/tests/GuestSceNet.cpp
docs/dev/debt/libSceNet.md
PR 8232 core/libs/prx/libSceNet/Export.cpp
core/libs/tests/GuestSceNet.cpp
docs/dev/debt/libSceNet.md
PR 8234 core/libs/prx/libSceNet/Export.cpp
core/libs/tests/GuestSceNet.cpp
docs/dev/debt/libSceNet.md
PR 8235 core/libs/prx/libSceNet/Export.cpp
core/libs/tests/GuestSceNet.cpp
docs/dev/debt/libSceNet.md
PR 8254 core/libs/prx/libSceNet/Export.cpp
docs/dev/debt/libSceNet.md
PR 8362 core/libs/prx/libSceNet/Export.cpp
core/libs/tests/GuestSceNet.cpp
docs/dev/debt/libSceNet.md
PR 8398 core/libs/tests/GuestSceNet.cpp
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6282350107 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8204#issuecomment-6282350107). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-20T03:03:45Z. --- <!-- 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 9506](https://www.github.com/boykopovar/AnyPS5/pull/9506) | `docs/dev/debt/libSceNet.md` [L15-16](https://github.com/boykopovar/AnyPS5/blob/6ef5a1c4c92272598b18adeb9b5414112f8d15ed/docs/dev/debt/libSceNet.md#L15-L16) | | | 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 6879](https://www.github.com/boykopovar/AnyPS5/pull/6879) | `core/libs/prx/libSceNet/Export.cpp` | | [PR 7201](https://www.github.com/boykopovar/AnyPS5/pull/7201) | `core/libs/prx/libSceNet/Export.cpp` | | [PR 8225](https://www.github.com/boykopovar/AnyPS5/pull/8225) | `core/libs/prx/libSceNet/Export.cpp`<br>`core/libs/tests/GuestSceNet.cpp`<br>`docs/dev/debt/libSceNet.md` | | [PR 8232](https://www.github.com/boykopovar/AnyPS5/pull/8232) | `core/libs/prx/libSceNet/Export.cpp`<br>`core/libs/tests/GuestSceNet.cpp`<br>`docs/dev/debt/libSceNet.md` | | [PR 8234](https://www.github.com/boykopovar/AnyPS5/pull/8234) | `core/libs/prx/libSceNet/Export.cpp`<br>`core/libs/tests/GuestSceNet.cpp`<br>`docs/dev/debt/libSceNet.md` | | [PR 8235](https://www.github.com/boykopovar/AnyPS5/pull/8235) | `core/libs/prx/libSceNet/Export.cpp`<br>`core/libs/tests/GuestSceNet.cpp`<br>`docs/dev/debt/libSceNet.md` | | [PR 8254](https://www.github.com/boykopovar/AnyPS5/pull/8254) | `core/libs/prx/libSceNet/Export.cpp`<br>`docs/dev/debt/libSceNet.md` | | [PR 8362](https://www.github.com/boykopovar/AnyPS5/pull/8362) | `core/libs/prx/libSceNet/Export.cpp`<br>`core/libs/tests/GuestSceNet.cpp`<br>`docs/dev/debt/libSceNet.md` | | [PR 8398](https://www.github.com/boykopovar/AnyPS5/pull/8398) | `core/libs/tests/GuestSceNet.cpp` |
oneandonlydean commented 2026-10-20 11:38:39 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-20T11:38:39Z.


Thanks, the parser looks right. I compared it against the shadPS4 function you cite on 4 million generated strings, and the results and outputs matched in every case. One thing blocks the merge, plus two small text fixes:

  1. Rebase, and remove main's placeholder. #8106 has since added a throwing declaration int sceNetEtherStrton(const char* str, void* address) to core/libs/prx/libSceNet/Export.cpp (after sceNetEmulationGet), in the same extern "C" block. Git merges the file cleanly, but the result doesn't compile: error: conflicting declaration of C function 'int sceNetEtherStrton(const char*, void*)'. Please delete that placeholder on rebase, along with its bullet in docs/dev/debt/libSceNet.md ("its signature follows SharpProspero … the throwing declaration only resolves the import"), and keep your own bullet. That also clears the current docs conflict.
  2. Reference link. In shadPS4 at d615b388, sceNetEtherStrton is at lines 1274-1297 of net.cpp. Lines 1206-1228 are epoll code. Please update the anchor in the debt entry and in the description.
  3. Description. "Absent from current main" and the "+1 declared export" progress note no longer apply after #8106.
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6289991322 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8204#issuecomment-6289991322). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-20T11:38:39Z. --- Thanks, the parser looks right. I compared it against the shadPS4 function you cite on 4 million generated strings, and the results and outputs matched in every case. One thing blocks the merge, plus two small text fixes: 1. **Rebase, and remove main's placeholder.** #8106 has since added a throwing declaration `int sceNetEtherStrton(const char* str, void* address)` to `core/libs/prx/libSceNet/Export.cpp` (after `sceNetEmulationGet`), in the same `extern "C"` block. Git merges the file cleanly, but the result doesn't compile: `error: conflicting declaration of C function 'int sceNetEtherStrton(const char*, void*)'`. Please delete that placeholder on rebase, along with its bullet in `docs/dev/debt/libSceNet.md` ("its signature follows SharpProspero … the throwing declaration only resolves the import"), and keep your own bullet. That also clears the current docs conflict. 2. **Reference link.** In shadPS4 at d615b388, `sceNetEtherStrton` is at lines 1274-1297 of `net.cpp`. Lines 1206-1228 are epoll code. Please update the anchor in the debt entry and in the description. 3. **Description.** "Absent from current main" and the "+1 declared export" progress note no longer apply after #8106.
orezraey commented 2026-10-21 12:03:07 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by orezraey on 2026-10-21T12:03:07Z.


A data point from a PS5, in case it helps this PR. I measured sceNetEtherStrton in a payload process on firmware 13.60 (libSceNet.sprx via dlopen/dlsym), with the output pre-filled with 0x5a. The console doesn't validate its input:

  • It returns 0 for any non-null text.
  • It reads the character pairs at offsets 0-1, 3-4, 6-7, 9-10, 12-13 and 15-16, ignores whatever is between them, and reads past the terminating NUL when the text is short.
  • Each byte is hi * 16 + lo truncated to 8 bits. Digits are c - '0', letters c - 'a' + 10 or c - 'A' + 10 (so g gives 16 and x 33), and :, -, ., space, + and NUL give 0x7f.
  • A null text or a null address returns 0x80410116 (EINVAL, errno 22), not EFAULT.
Text Bytes written (between the 0x5a guards)
00:01:02:0A:0b:0F 00 01 02 0a 0b 0f
0:1:2:a:B:f 7f f2 1f ff 08 21
0-1-2-a-B-f 7f f2 1f ff 6f 90
000:1:2:3:4:5 00 f1 9f f4 cf f1, with no error
0:1:2:3:4:g 7f f2 af 00 8c f2, with no error
"" fc ce e2 e2 5f b5: the bytes after the NUL

So the strict validation and the EFAULT here would differ from the console for anything other than a well-formed 17-character address. The probe source and the full log (24 strton cases) are in this gist.

AI-assisted: yes (Claude Code). The measurements are from a console I have access to.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6315423932 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8204#issuecomment-6315423932). Originally posted by [orezraey](https://github.com/orezraey) on 2026-10-21T12:03:07Z. --- A data point from a PS5, in case it helps this PR. I measured `sceNetEtherStrton` in a payload process on firmware 13.60 (`libSceNet.sprx` via `dlopen`/`dlsym`), with the output pre-filled with 0x5a. The console doesn't validate its input: - It returns 0 for any non-null text. - It reads the character pairs at offsets 0-1, 3-4, 6-7, 9-10, 12-13 and 15-16, ignores whatever is between them, and reads past the terminating NUL when the text is short. - Each byte is `hi * 16 + lo` truncated to 8 bits. Digits are `c - '0'`, letters `c - 'a' + 10` or `c - 'A' + 10` (so `g` gives 16 and `x` 33), and `:`, `-`, `.`, space, `+` and NUL give 0x7f. - A null text or a null address returns `0x80410116` (`EINVAL`, errno 22), not `EFAULT`. | Text | Bytes written (between the 0x5a guards) | |---|---| | `00:01:02:0A:0b:0F` | `00 01 02 0a 0b 0f` | | `0:1:2:a:B:f` | `7f f2 1f ff 08 21` | | `0-1-2-a-B-f` | `7f f2 1f ff 6f 90` | | `000:1:2:3:4:5` | `00 f1 9f f4 cf f1`, with no error | | `0:1:2:3:4:g` | `7f f2 af 00 8c f2`, with no error | | `""` | `fc ce e2 e2 5f b5`: the bytes after the NUL | So the strict validation and the `EFAULT` here would differ from the console for anything other than a well-formed 17-character address. The probe source and the full log (24 `strton` cases) are in [this gist](https://gist.github.com/orezraey/789290577123af3c45b340d6db6f395c). AI-assisted: yes (Claude Code). The measurements are from a console I have access to.
oneandonlydean commented 2026-10-21 12:12:26 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-21T12:12:26Z.


@realshinmalphur, and thanks @orezraey for measuring it on a console. That measurement changes what this function should do: the parser here (and the shadPS4 version I compared it against) validates its input, but firmware 13.60 doesn't. Against that, sceNetEtherStrton in this PR differs in three places:

  1. A null text or address returns NET_EFAULT here; the console returns 0x80410116 (EINVAL).
  2. Malformed or short text returns NET_EINVAL here; the console returns 0 and stores whatever its pair decoding produces (:, -, ., space, + and NUL count as 0x7f).
  3. Single-digit groups (a:b:c:d:e:f) are accepted here; the console always reads the pairs at offsets 0-1, 3-4, 6-7, 9-10, 12-13 and 15-16.

Could you change the null case to EINVAL, and either follow the measured decoding or list the remaining difference in the debt entry? Reading past the terminating NUL is a console quirk that doesn't need copying; please say in the debt entry what you do there instead. The rebase that removes #8106's throwing placeholder is still needed, as is the link fix.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6315602627 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8204#issuecomment-6315602627). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-21T12:12:26Z. --- @realshinmalphur, and thanks @orezraey for measuring it on a console. That measurement changes what this function should do: the parser here (and the shadPS4 version I compared it against) validates its input, but firmware 13.60 doesn't. Against that, `sceNetEtherStrton` in this PR differs in three places: 1. A null text or address returns `NET_EFAULT` here; the console returns `0x80410116` (`EINVAL`). 2. Malformed or short text returns `NET_EINVAL` here; the console returns 0 and stores whatever its pair decoding produces (`:`, `-`, `.`, space, `+` and NUL count as 0x7f). 3. Single-digit groups (`a:b:c:d:e:f`) are accepted here; the console always reads the pairs at offsets 0-1, 3-4, 6-7, 9-10, 12-13 and 15-16. Could you change the null case to `EINVAL`, and either follow the measured decoding or list the remaining difference in the debt entry? Reading past the terminating NUL is a console quirk that doesn't need copying; please say in the debt entry what you do there instead. The rebase that removes #8106's throwing placeholder is still needed, as is the link fix.
realshinmalphur commented 2026-10-21 17:00:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by realshinmalphur on 2026-10-21T17:00:49Z.


@oneandonlydean @orezraey Thanks for the review and console measurements. Updated in f923ebb20 (source: 89da7e6c0, tests: d5e2042c5).

  • Integrated main through GitHub’s conflict-resolution merge, removed #8106’s duplicate throwing declaration and obsolete debt bullet, and confirmed the published tree matches the tested local tree exactly.
  • Null arguments now return EINVAL (0x80410116 / errno 22). Decoding uses fixed character pairs with ignored separators/trailing text, alphabetic values beyond f, and eight-bit truncation.
  • The deliberate short-string difference is explicit in debt: a NUL within the first 17 bytes returns EINVAL and leaves the output untouched; no reads beyond the terminator. Non-ASCII digit bytes throw because their decoding is unmeasured, while separator bytes are ignored.
  • Corrected the shadPS4 anchor to L1274-L1297 and refreshed the description to remove the outdated new-export/progress claims and identify the console measurements as the new reference.

Validation: built the actual complete libc, libkernel, libSceNet and libSceNetCtl targets using the disclosed external harness. Full GuestSceNet and focused parser tests each passed ten consecutive runs (12.03 s total); actual Export.cpp plus focused tests passed Clang ASan/UBSan. Updated tests fail against our previous strict implementation. Conventions/whitespace checks pass. I have no PS5; the console evidence is @orezraey’s, not an independent console rerun. Please rerun the collaborator-triggered full Linux/Windows build for this head. AI-assisted: yes (Codex).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6321723643 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8204#issuecomment-6321723643). Originally posted by [realshinmalphur](https://github.com/realshinmalphur) on 2026-10-21T17:00:49Z. --- @oneandonlydean @orezraey Thanks for the review and console measurements. Updated in f923ebb20 (source: 89da7e6c0, tests: d5e2042c5). - Integrated main through GitHub’s conflict-resolution merge, removed #8106’s duplicate throwing declaration and obsolete debt bullet, and confirmed the published tree matches the tested local tree exactly. - Null arguments now return EINVAL (0x80410116 / errno 22). Decoding uses fixed character pairs with ignored separators/trailing text, alphabetic values beyond f, and eight-bit truncation. - The deliberate short-string difference is explicit in debt: a NUL within the first 17 bytes returns EINVAL and leaves the output untouched; no reads beyond the terminator. Non-ASCII digit bytes throw because their decoding is unmeasured, while separator bytes are ignored. - Corrected the shadPS4 anchor to L1274-L1297 and refreshed the description to remove the outdated new-export/progress claims and identify the console measurements as the new reference. Validation: built the actual complete libc, libkernel, libSceNet and libSceNetCtl targets using the disclosed external harness. Full GuestSceNet and focused parser tests each passed ten consecutive runs (12.03 s total); actual Export.cpp plus focused tests passed Clang ASan/UBSan. Updated tests fail against our previous strict implementation. Conventions/whitespace checks pass. I have no PS5; the console evidence is @orezraey’s, not an independent console rerun. Please rerun the collaborator-triggered full Linux/Windows build for this head. AI-assisted: yes (Codex).
lost9409 commented 2026-10-21 23:38:10 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by lost9409 on 2026-10-21T23:38:10Z.


Windows test report: guest_sce_net passed in 1.42 seconds.
Environment: Windows 11 Pro build 26200, Intel i7-14700KF, WinLibs GCC 15.2.0 r7, CMake 4.3.1, Ninja 1.13.2.
Applied the changes to Export.cpp and GuestSceNet.cpp from PR commit f923ebb200 onto base a6dcea9279, alongside the unrelated test fixes from #8310 and #9056.
Built guest_sce_net_tests and ran ctest --test-dir build -R "^guest_sce_net$" -V: 1 passed, 0 failed.
One run; no title execution or full-suite rerun after this patch. Log attached.

AnyPS5-net-8204.log

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6328991655 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8204#issuecomment-6328991655). Originally posted by [lost9409](https://github.com/lost9409) on 2026-10-21T23:38:10Z. --- Windows test report: guest_sce_net passed in 1.42 seconds. Environment: Windows 11 Pro build 26200, Intel i7-14700KF, WinLibs GCC 15.2.0 r7, CMake 4.3.1, Ninja 1.13.2. Applied the changes to Export.cpp and GuestSceNet.cpp from PR commit f923ebb20011a746bf734c7cf5c9d8d86c248980 onto base a6dcea9279b53b3a39c13695eac66f7c8b5b503c, alongside the unrelated test fixes from #8310 and #9056. Built guest_sce_net_tests and ran ctest --test-dir build -R "^guest_sce_net$" -V: 1 passed, 0 failed. One run; no title execution or full-suite rerun after this patch. Log attached. [AnyPS5-net-8204.log](https://github.com/user-attachments/files/33793284/AnyPS5-net-8204.log)
MarcZX10 commented 2026-10-22 02:07:02 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T02:07:02Z.


I am reviewing #9506, which adds sceNetSetDnsInfo, sceNetSetDns6Info and sceNetGetDns6Info plus 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 in Depends on and the overlap note.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6330951999 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8204#issuecomment-6330951999). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-22T02:07:02Z. --- I am reviewing #9506, which adds `sceNetSetDnsInfo`, `sceNetSetDns6Info` and `sceNetGetDns6Info` plus 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 in `Depends on` and the overlap note.
realshinmalphur commented 2026-10-22 03:15:42 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by realshinmalphur on 2026-10-22T03:15:42Z.


@MarcZX10 @Noxy-HNR I compared #9506 at bed7b5c2e against #8204 updated on main 6ef5a1c4c. Our update is now published at 24b797724; its full tree matches the locally tested merge exactly.

  • Exports: #8204 only implements sceNetEtherStrton. It does not modify sceNetSetDnsInfo, sceNetSetDns6Info, sceNetGetDnsInfo or sceNetGetDns6Info, nor DNS state/helpers.
  • Tests/CMake: #8204 adds CheckEtherAddress and its invocation to existing GuestSceNet.cpp; it does not change CMake or add a test target. #9506 adds GuestNetDnsInfo.cpp and its own registration. No common test insertion.
  • Debt: both touch the Unknown function info section, but different entries. A pairwise git merge-tree auto-merges Export.cpp; the only conflict is adjacent EtherStrton/GetDnsInfo debt lines. Resolve it by retaining our measured EtherStrton entry, #9506’s updated GetDnsInfo entry and its new DNS debt bullet.

Author-side ordering confirmation: #9506 may land before #8204 without depending on us. There is no functional prerequisite either way; whichever lands second must resolve the adjacent debt hunk without dropping either change. Depends on remains none, and this confirmation is now in our description. @Noxy-HNR please confirm/record the #9506-first order on your side if that is your preferred landing order; I am not treating this as a bilateral agreement yet or as resolving your other PR overlaps.

Separately resolved #8204’s conflict with current main, preserving main’s new debt entries and removing the reintroduced obsolete EtherStrton placeholder debt bullet. No parser behavior changes. Rebuilt actual libc/libkernel/libSceNet/libSceNetCtl via the previously disclosed external harness; complete current GuestSceNet plus focused parser tests each pass three consecutive runs (2/2, 3.60 seconds total). Conventions/whitespace pass. This is not a combined runtime test of #9506, full-project CI or a console run. @lost9409 thanks for the separately reported Windows focused test. Full Linux/Windows workflow rerun is still requested for this new head. AI-assisted: yes (Codex).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6331798433 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8204#issuecomment-6331798433). Originally posted by [realshinmalphur](https://github.com/realshinmalphur) on 2026-10-22T03:15:42Z. --- @MarcZX10 @Noxy-HNR I compared #9506 at bed7b5c2e against #8204 updated on main 6ef5a1c4c. Our update is now published at 24b797724; its full tree matches the locally tested merge exactly. - Exports: #8204 only implements sceNetEtherStrton. It does not modify sceNetSetDnsInfo, sceNetSetDns6Info, sceNetGetDnsInfo or sceNetGetDns6Info, nor DNS state/helpers. - Tests/CMake: #8204 adds CheckEtherAddress and its invocation to existing GuestSceNet.cpp; it does not change CMake or add a test target. #9506 adds GuestNetDnsInfo.cpp and its own registration. No common test insertion. - Debt: both touch the Unknown function info section, but different entries. A pairwise git merge-tree auto-merges Export.cpp; the only conflict is adjacent EtherStrton/GetDnsInfo debt lines. Resolve it by retaining our measured EtherStrton entry, #9506’s updated GetDnsInfo entry and its new DNS debt bullet. Author-side ordering confirmation: #9506 may land before #8204 without depending on us. There is no functional prerequisite either way; whichever lands second must resolve the adjacent debt hunk without dropping either change. Depends on remains none, and this confirmation is now in our description. @Noxy-HNR please confirm/record the #9506-first order on your side if that is your preferred landing order; I am not treating this as a bilateral agreement yet or as resolving your other PR overlaps. Separately resolved #8204’s conflict with current main, preserving main’s new debt entries and removing the reintroduced obsolete EtherStrton placeholder debt bullet. No parser behavior changes. Rebuilt actual libc/libkernel/libSceNet/libSceNetCtl via the previously disclosed external harness; complete current GuestSceNet plus focused parser tests each pass three consecutive runs (2/2, 3.60 seconds total). Conventions/whitespace pass. This is not a combined runtime test of #9506, full-project CI or a console run. @lost9409 thanks for the separately reported Windows focused test. Full Linux/Windows workflow rerun is still requested for this new head. AI-assisted: yes (Codex).
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!8204
No description provided.