Skip to content

Commit c231c38

Browse files
authored
Unrolled build for rust-lang#135745
Rollup merge of rust-lang#135745 - bardiharborow:std/net/rfc9602, r=cuviper Recognise new IPv6 non-global range from IETF RFC 9602 This PR adds the `5f00::/16` range defined by [IETF RFC 9602](https://datatracker.ietf.org/doc/rfc9602/) to those ranges which `Ipv6Addr::is_global` recognises as a non-global IP. This range is used for Segment Routing (SRv6) SIDs. See also: https://www.iana.org/assignments/iana-ipv6-special-registry/iana-ipv6-special-registry.xhtml Unstable tracking issue: rust-lang#27709
2 parents 40507bd + ea99e81 commit c231c38

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

library/core/src/net/ip_addr.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1623,6 +1623,8 @@ impl Ipv6Addr {
16231623
// IANA says N/A.
16241624
|| matches!(self.segments(), [0x2002, _, _, _, _, _, _, _])
16251625
|| self.is_documentation()
1626+
// Segment Routing (SRv6) SIDs (`5f00::/16`)
1627+
|| matches!(self.segments(), [0x5f00, ..])
16261628
|| self.is_unique_local()
16271629
|| self.is_unicast_link_local())
16281630
}

library/coretests/tests/net/ip_addr.rs

+2
Original file line numberDiff line numberDiff line change
@@ -689,6 +689,8 @@ fn ipv6_properties() {
689689

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

692+
check!("5f00::", &[0x5f, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], unicast_global);
693+
692694
check!("fc00::", &[0xfc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], unique_local);
693695

694696
check!(

0 commit comments

Comments
 (0)