feat(net): parse Ethernet address strings #8204
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/8204"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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:EINVAL(0x80410116, errno 22). Successful calls preserve guest errno and write exactly six bytes.EINVALwithout changing the destination. Do not reproduce the console's reads beyond the terminating NUL. This includes short single-digit-group inputs.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
bed7b5c2ewith this PR updated on main6ef5a1c4c. No shared export implementation or CMake/test insertion: this PR changes onlysceNetEtherStrton, addsCheckEtherAddressto 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, soDepends 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: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 earlierf923ebbfiles to basea6dcea9with unrelated fixes #8310/#9056; that is contributor-provided evidence, not our own Windows/full-suite run.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)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.
main)docs/dev/debt/libSceNet.mdL15-16Some 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.
core/libs/prx/libSceNet/Export.cppcore/libs/tests/GuestSceNet.cppdocs/dev/debt/libSceNet.mdcore/libs/tests/GuestSceNet.cppcore/libs/prx/libSceNet/Export.cppcore/libs/prx/libSceNet/Export.cppcore/libs/prx/libSceNet/Export.cppcore/libs/tests/GuestSceNet.cppdocs/dev/debt/libSceNet.mdcore/libs/prx/libSceNet/Export.cppcore/libs/tests/GuestSceNet.cppdocs/dev/debt/libSceNet.mdcore/libs/prx/libSceNet/Export.cppcore/libs/tests/GuestSceNet.cppdocs/dev/debt/libSceNet.mdcore/libs/prx/libSceNet/Export.cppcore/libs/tests/GuestSceNet.cppdocs/dev/debt/libSceNet.mdcore/libs/prx/libSceNet/Export.cppdocs/dev/debt/libSceNet.mdcore/libs/prx/libSceNet/Export.cppcore/libs/tests/GuestSceNet.cppdocs/dev/debt/libSceNet.mdcore/libs/tests/GuestSceNet.cppImported 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:
int sceNetEtherStrton(const char* str, void* address)tocore/libs/prx/libSceNet/Export.cpp(aftersceNetEmulationGet), in the sameextern "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 indocs/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.sceNetEtherStrtonis at lines 1274-1297 ofnet.cpp. Lines 1206-1228 are epoll code. Please update the anchor in the debt entry and in the description.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
sceNetEtherStrtonin a payload process on firmware 13.60 (libSceNet.sprxviadlopen/dlsym), with the output pre-filled with 0x5a. The console doesn't validate its input:hi * 16 + lotruncated to 8 bits. Digits arec - '0', lettersc - 'a' + 10orc - 'A' + 10(soggives 16 andx33), and:,-,., space,+and NUL give 0x7f.0x80410116(EINVAL, errno 22), notEFAULT.00:01:02:0A:0b:0F00 01 02 0a 0b 0f0:1:2:a:B:f7f f2 1f ff 08 210-1-2-a-B-f7f f2 1f ff 6f 90000:1:2:3:4:500 f1 9f f4 cf f1, with no error0:1:2:3:4:g7f f2 af 00 8c f2, with no error""fc ce e2 e2 5f b5: the bytes after the NULSo the strict validation and the
EFAULThere would differ from the console for anything other than a well-formed 17-character address. The probe source and the full log (24strtoncases) are in this gist.AI-assisted: yes (Claude Code). The measurements are from a console I have access to.
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,
sceNetEtherStrtonin this PR differs in three places:NET_EFAULThere; the console returns0x80410116(EINVAL).NET_EINVALhere; the console returns 0 and stores whatever its pair decoding produces (:,-,., space,+and NUL count as 0x7f).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.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).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).
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
f923ebb200onto basea6dcea9279, 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
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T02:07:02Z.
I am reviewing #9506, which adds
sceNetSetDnsInfo,sceNetSetDns6InfoandsceNetGetDns6Infoplus 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 inDepends onand the overlap note.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 at24b797724; its full tree matches the locally tested merge exactly.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).