fix(libkernel): follow FreeBSD inet text rules #3530
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3530"
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 MarcZX10 on 2026-10-11T12:34:01Z.
What
Replace the host
inet_ptonandinet_ntopcalls in libkernel with explicit parsing and formatting that follows the guest's observed FreeBSD 11.4 text rules. This avoids platform differences such as accepting leading zeros in dotted IPv4 tails and printing IPv4-mapped IPv6 addresses as hexadecimal groups. The implementation and behavior assumptions are recorded inTechnicalDebt.mdbecause console behavior remains unverified.This carries the implementation originally submitted in the now-closed #2768. The commit keeps its original author, Hussein Kadhim.
Closes #3126.
Tested
Linux x86-64, GCC 12.2, Release:
guest_addressespassed three consecutive CTest runs.python3 tools/check_conventions.py --base upstream/mainandgit diff --check upstream/main...HEADpassed.I did not independently run the Windows differential suite or test on console hardware. The issue author reports extensive differential comparisons against FreeBSD 11.4 with no divergences.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-11T12:35:51Z.
CI finished checking this head: intake, eligibility, report, Linux/macOS register-context, and macOS write-watch checks pass. Full Linux/Windows builds are skipped by the repository's contributor workflow. Conventions and all three relinker jobs fail during checkout, before evaluating this diff, with
No url found for submodule path '3rdparty/imgui' in .gitmoduleson base1e8fff68. Open PR #3511 tracks the shared checkout issue.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-11T12:47:11Z.
Update: #3511 merged and removed the orphan gitlink from
main. I rebased this PR ontoa11c8f7f; the full Linux Release build and three repeatedguest_addressesruns pass on the new head. Conventions and diff checks pass locally. CI is running again against the fixed base.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-11T12:52:56Z.
The rerun on current
mainhas finished: conventions, eligibility/report, Ubuntu and Intel macOS register-context/write-watch, and all three relinker jobs pass. Full Linux/Windows builds remain skipped by the contributor workflow. The local Release build and three repeatedguest_addressesruns also pass on this head.Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T21:32:15Z.
Checked against FreeBSD releng/11.4
inet_pton.c/inet_ntop.c(leading zeros, single::, dotted tail only last, longest-zero-run rule, dotted output only for::a.b.c.d/::ffff:a.b.c.d, ENOSPC bound). Also ran a differential fuzz of the new code against glibc'sinet_pton/inet_ntopon Linux (30M random texts and 30M binary addresses, both families): 0 divergences.guest_addressespasses on the PR merged onto currentmain; conventions CI is green. Merging.