radicle/node: Address::is_local for DNS names
Address:is_local would return false for all DNS names. This is
incorrect, with one counterexample being the name “localhost”, which
generally resolves to a local (usually loopback) address.
The function is changed to catch “localhost”, but also the top level domain “.localhost”, which is reserved in RFC 2606, Section 2.
Address::is_routable would return true for all DNS names. While it
is much harder to decide global routeability based on a domain name, as
these usually have to be resolved to an address before being able to
judge routability, there is one particular class of names, namely local
ones (see above), which are not globally routable.
radicle/node: Revisit routeability of IP addresses
All IPv6 addresses would be considered globally routeable, even though the Rust standard library offers convenience functions to check for loopback, link-local addresses etc.
Improve checks for IPv6 routeability to catch the most obvious cases of local or unspecified addresses.
Refactor the check for IPv4 routeability to be more readable and refer to RFCs, IANA lists, and Rust stabilization tracking issues as appropriate.
radicle/node: Address::is_local for DNS names
Address:is_local would return false for all DNS names. This is
incorrect, with one counterexample being the name “localhost”, which
generally resolves to a local (usually loopback) address.
The function is changed to catch “localhost”, but also the top level domain “.localhost”, which is reserved in RFC 2606, Section 2.
Address::is_routable would return true for all DNS names. While it
is much harder to decide global routeability based on a domain name, as
these usually have to be resolved to an address before being able to
judge routability, there is one particular class of names, namely local
ones (see above), which are not globally routable.
radicle/node: Revisit routeability of IP addresses
All IPv6 addresses would be considered globally routeable, even though the Rust standard library offers convenience functions to check for loopback, link-local addresses etc.
Improve checks for IPv6 routeability to catch the most obvious cases of local or unspecified addresses.
Refactor the check for IPv4 routeability to be more readable and refer to RFCs, IANA lists, and Rust stabilization tracking issues as appropriate.
Rebase