Repository navigation
Commit a0eb073
authored
* Fix getScope() and add ULA/6to4/Documentation/NAT64 to getType() (closes #122)
The 4-bit scope nibble (RFC 4291 §2.7) only applies to multicast
addresses, but getScope() read it for every address. As a result
fe80::… returned 'Reserved' (nibble 0) and 2002:: returned 'Link
local' (nibble 2). Now multicast addresses use the nibble and
unicast addresses derive a scope from their type per RFC 4007 §6.
Also extend the TYPES table so getType() recognizes ULAs (fc00::/7),
6to4 (2002::/16), documentation (2001:db8::/32), and NAT64
(64:ff9b::/96, 64:ff9b:1::/48). Fix a related isMulticast() bug
where ff01::1 etc. returned false because their getType() string
includes a parenthesized subtype.
* Loopback scope is Link-Local, not Interface-Local (RFC 4291 §2.5.3)
The Interface-Local scope (multicast scope 1) is only defined for
loopback transmission of multicast. RFC 4291 §2.5.3 explicitly
states that the unicast loopback address ::1 is "treated as having
Link-Local scope".
* Regenerate README
1 parent ec52105 commit a0eb073
4 files changed
Lines changed: 143 additions & 49 deletions
0 commit comments