Skip to content

Add is_documentation for IPv6 #32207

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 18, 2016
Merged

Add is_documentation for IPv6 #32207

merged 1 commit into from
Mar 18, 2016

Conversation

achanda
Copy link
Contributor

@achanda achanda commented Mar 12, 2016

This function returns true if the given IPv6 is reserved for
documentation. Also, reject this block in the is_global check

@alexcrichton
Copy link
Member

Could you elaborate on the rationale for this addition as well? We aren't currently very principled about the query methods we have so I'm largely just curious.

@alexcrichton alexcrichton added the T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. label Mar 13, 2016
@achanda
Copy link
Contributor Author

achanda commented Mar 13, 2016

RFC 3849 defines this range to be used for documentation only [1]. No end hosts should be assigned addresses in this range. Thus this address can not be a globally routable address. This is how python behaves for this range

$ python3
Python 3.5.1 (default, Mar 13 2016, 13:29:57) 
[GCC 4.2.1 Compatible Apple LLVM 7.0.2 (clang-700.1.81)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import ipaddress
>>> ip = ipaddress.ip_address('2001:db8::')
>>> ip.is_global
False
>>> ip.is_private
True

Please let me know if I should clarify something else.

[1] https://tools.ietf.org/html/rfc3849

@bors
Copy link
Collaborator

bors commented Mar 14, 2016

☔ The latest upstream changes (presumably #32211) made this pull request unmergeable. Please resolve the merge conflicts.

This function returns true if the given IPv6 is reserved for
documentation. Also, reject this block in the is_global check
@alexcrichton
Copy link
Member

Seems reasonable to me! Tagging with T-libs just to make sure this comes up during triage.

@alexcrichton
Copy link
Member

The libs team discussed this during triage yesterday and the decision was to merge, thanks @achanda!

@bors: r+ aa22b4e

@alexcrichton alexcrichton removed the T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. label Mar 17, 2016
@bors
Copy link
Collaborator

bors commented Mar 18, 2016

⌛ Testing commit aa22b4e with merge a77d7bd...

bors added a commit that referenced this pull request Mar 18, 2016
Add is_documentation for IPv6

This function returns true if the given IPv6 is reserved for
documentation. Also, reject this block in the is_global check
@bors bors merged commit aa22b4e into rust-lang:master Mar 18, 2016
@achanda achanda deleted the ipv6-doc branch March 18, 2016 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants