Skip to content

RFC Verification/Hardening#108

Merged
zanbaldwin merged 3 commits into
6.xfrom
z/rfc-hardening
Jun 8, 2026
Merged

RFC Verification/Hardening#108
zanbaldwin merged 3 commits into
6.xfrom
z/rfc-hardening

Conversation

@zanbaldwin

Copy link
Copy Markdown
Member

No description provided.

@zanbaldwin zanbaldwin self-assigned this Jun 4, 2026
@greptile-apps

greptile-apps Bot commented Jun 5, 2026

Copy link
Copy Markdown

Greptile Summary

Aligns isPublicUse(), isUnicastGlobal(), and isDocumentation() with the current IANA special-purpose address registries for both IPv4 and IPv6, and refreshes all RFC citations throughout the public interface.

  • IPv6 isUnicastGlobal() now excludes IPv4-mapped (::ffff:0:0/96), 6to4/derived (2002::/16), benchmarking (2001:2::/48), the full IETF Protocol Assignments block (2001::/23) minus seven globally-reachable carve-outs, NAT64 local-use (64:ff9b:1::/48), discard-only (100::/64), dummy prefix (100:0:0:1::/64), and SRv6 SID (5f00::/16).
  • IPv4 adds MCAST-TEST-NET (233.252.0.0/24) to isDocumentation() and excludes the 6a44-relay anycast address 192.88.99.2/32 from isPublicUse(); isFutureReserved() now correctly carves out the limited broadcast address per RFC 8190.
  • IpInterface.php fixes a copy-paste error in the IANA IPv6 registry @see URL (it previously pointed to iana-ipv4-special-registry/iana-ipv6-special-registry instead of iana-ipv6-special-registry/iana-ipv6-special-registry).

Confidence Score: 5/5

Safe to merge; the classification changes are well-grounded in IANA registry entries and all hex prefix values are correct.

All new block checks use verified hex values; the isIetfProtocolAssignment() carve-out logic correctly preserves the seven globally-reachable sub-allocations; the IPv4 edge-case handling for 192.88.99.2 and 233.252.0.0/24 is accurate. The only gaps are missing positive test entries for a handful of IETF Protocol Assignment carve-outs, which do not affect runtime correctness.

The isIetfProtocolAssignment() carve-outs in src/Version/IPv6.php and the corresponding test data in tests/DataProvider/IPv6.php would benefit from a second look to ensure the three anycast /128 addresses and the AS112-v6 /48 block are covered by positive test cases.

Important Files Changed

Filename Overview
src/Version/IPv6.php Adds isIetfProtocolAssignment(), isNat64LocalUse(), isDiscardOnly(), isDummyPrefix(), and isSegmentRoutingSid() private helpers; isUnicastGlobal() now excludes mapped, derived, benchmarking, and all of the above; all hex values verified correct against RFC/IANA registry; no logic bugs found.
src/Version/IPv4.php Adds MCAST-TEST-NET 233.252.0.0/24 to isDocumentation(); excludes 192.88.99.2/32 from isPublicUse(); carves 255.255.255.255 out of isFutureReserved(); all hex values are correct.
src/IpInterface.php Documentation-only improvements: RFC citations updated and a wrong IANA URL path fixed (iana-ipv4-special-registry/iana-ipv6-special-registry → iana-ipv6-special-registry/iana-ipv6-special-registry).
tests/DataProvider/IPv6.php Updates categorization for mapped, derived, and benchmarking addresses (no longer UNICAST_GLOBAL); adds entries for 2001:1::1, terminated ORCHID 2001:10::, 3fff::1, NAT64 local-use, discard-only, dummy prefix, and SRv6 SID; carve-outs for 2001:1::2, 2001:1::3, and AS112-v6 2001:4:112::/48 are missing positive test cases.
tests/DataProvider/IPv4.php Adds test entries for 192.88.99.1 (public), 192.88.99.2 (not public), and 233.252.0.1 (MULTICAST

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["IPv6::isUnicastGlobal()"] --> B{isUnicast?}
    B -- No --> Z["false"]
    B -- Yes --> C{isLoopback?}
    C -- Yes --> Z
    C -- No --> D{isLinkLocal?}
    D -- Yes --> Z
    D -- No --> E{isUniqueLocal?}
    E -- Yes --> Z
    E -- No --> F{isUnspecified?}
    F -- Yes --> Z
    F -- No --> G{"isMapped() (NEW: ::ffff:0:0/96)"}
    G -- Yes --> Z
    G -- No --> H{isDocumentation?}
    H -- Yes --> Z
    H -- No --> I{"isBenchmarking() (2001:2::/48)"}
    I -- Yes --> Z
    I -- No --> J{"isIetfProtocolAssignment() (NEW: 2001::/23 minus carve-outs)"}
    J -- Yes --> Z
    J -- No --> K{"isDerived() (NEW: 2002::/16)"}
    K -- Yes --> Z
    K -- No --> L{"isNat64LocalUse() (NEW: 64:ff9b:1::/48)"}
    L -- Yes --> Z
    L -- No --> M{"isDiscardOnly() (NEW: 100::/64)"}
    M -- Yes --> Z
    M -- No --> N{"isDummyPrefix() (NEW: 100:0:0:1::/64)"}
    N -- Yes --> Z
    N -- No --> O{"isSegmentRoutingSid() (NEW: 5f00::/16)"}
    O -- Yes --> Z
    O -- No --> Y["true (globally reachable)"]
Loading

Reviews (2): Last reviewed commit: "docs: 📚 update CHANGELOG" | Re-trigger Greptile

Comment thread src/Version/IPv6.php
@zanbaldwin zanbaldwin added the enhancement Existing feature enhancement (patch version bump) label Jun 7, 2026
@zanbaldwin zanbaldwin merged commit df97507 into 6.x Jun 8, 2026
24 checks passed
@zanbaldwin zanbaldwin deleted the z/rfc-hardening branch June 8, 2026 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Existing feature enhancement (patch version bump)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant