Skip to content

Commit

Permalink
Revert is_unicast_global changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jstasiak committed Dec 27, 2023
1 parent d845f61 commit afa0ea9
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
3 changes: 0 additions & 3 deletions library/core/src/net/ip_addr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1692,7 +1692,6 @@ impl Ipv6Addr {
/// - unique local addresses
/// - the unspecified address
/// - the address range reserved for documentation
/// - 6to4 addresses
///
/// This method returns [`true`] for site-local addresses as per [RFC 4291 section 2.5.7]
///
Expand Down Expand Up @@ -1726,8 +1725,6 @@ impl Ipv6Addr {
&& !self.is_unspecified()
&& !self.is_documentation()
&& !self.is_benchmarking()
// 6to4 (`2002::/16`), not documented as globally reachable by IANA
&& self.segments()[0] != 0x2002
}

/// Returns the address's multicast scope if the address is multicast.
Expand Down
2 changes: 1 addition & 1 deletion library/core/tests/net/ip_addr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@ fn ipv6_properties() {
global | unicast_global
);

check!("2002::", &[0x20, 0x02, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
check!("2002::", &[0x20, 0x02, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], unicast_global);

check!("fc00::", &[0xfc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], unique_local);

Expand Down

0 comments on commit afa0ea9

Please sign in to comment.