| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
Add isGlobal() and pin the classifiers to the IANA special-purpose registries (#224) * Add isGlobal() and pin the classifiers to the IANA special-purpose registries A guard written as an OR of named classifiers covers only the ranges it names, and the IANA registries hold more ranges than there are names. A differential sweep of every registry block boundary against Python's ipaddress found eight ranges no classifier caught: 0.0.0.0/8, the IETF protocol assignments in 192.0.0.0/24 and 2001::/23, the three IPv4 documentation blocks, 198.18.0.0/15, 240.0.0.0/4, 100::/64 and 100:0:0:1::/64, and 3fff::/20. isGlobal() on both classes answers from a table that mirrors the registry row for row, taking the most specific entry's Globally Reachable column, treating multicast as not global, and answering for the embedded IPv4 address of mapped and NAT64 well-known forms. SECURITY and the README point guards at it. For parity with the IPv6 side, Address4 gains isDocumentation(), isBenchmarking() and isReserved(); Address6.isDocumentation() covers 3fff::/20 and Address6 gains isBenchmarking(); getType() learns Benchmarking, Discard-only and the second Documentation block. test/data/iana-corpus.json is generated by scripts/gen-iana-corpus.py from the registry CSVs checked in beside it: every block's first, last, neighboring and middle addresses plus their mapped and NAT64 forms, each carrying the registry's answer and Python's. The suite asserts isGlobal() matches the registry on all 592 and the named classifiers match Python, with the four rows where Python 3.14 and the registry disagree listed as tripwires. * Gate Address6.isGlobal() on the 2000::/3 global unicast allocation The special-purpose registry lists exceptions, but the IANA IPv6 Address Space Registry says only 2000::/3 is allocated for global unicast at all, so the deprecated site-local fec0::/10, the deprecated IPv4-compatible ::/96, and unallocated space such as 4000::/3 have nowhere to route. isGlobal() answered true for all of them; a survey of recent SSRF advisories found fec0::/10 named as a deny-list gap (GHSA-w98g-5w9p-p3rc). The address-space registry CSV joins the fixtures and its block boundaries join the corpus (730 probes). getType() names the two deprecated ranges. | 19 天前 | |
Merge commit from fork | 4 个月前 | |
more formatting, remove unused packages | 2 年前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 19 天前 | ||
| 4 个月前 | ||
| 2 年前 |