-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Fix is_global special address handling #119006
Conversation
r? @thomcc (rustbot has picked a reviewer for you, use r? to override) |
Cross-referencing this comment for some context: #27709 (comment) |
After considering it some more I'm currently thinking this PR should only change |
I don't have enough context here to review this well. r? libs |
I think this is correct, but can you squash the revert commit so it doesn't disrupt git-blame? |
IANA explicitly documents 192.0.0.9/32, 192.0.0.9/32 and 2001:30::/28 as globally reachable[1][2] and the is_global implementations declare following IANA so let's make this happen. In case of 2002::/16 IANA says N/A so I think it's safe to say we shouldn't return true there either. [1] https://www.iana.org/assignments/iana-ipv4-special-registry/iana-ipv4-special-registry.xhtml [2] https://www.iana.org/assignments/iana-ipv6-special-registry/iana-ipv6-special-registry.xhtml
afa0ea9
to
4621357
Compare
Sure thing, done. I made a small whitespace change and added tests for two edge cases to make sure we're handling everything right. |
@bors r+ rollup |
…iaskrgr Rollup of 11 pull requests Successful merges: - rust-lang#115046 (Use version-sorting for all sorting) - rust-lang#118915 (Add some comments, add `can_define_opaque_ty` check to `try_normalize_ty_recur`) - rust-lang#119006 (Fix is_global special address handling) - rust-lang#119637 (Pass LLVM error message back to pass wrapper.) - rust-lang#119715 (Exhaustiveness: abort on type error) - rust-lang#119763 (Cleanup things in and around `Diagnostic`) - rust-lang#119788 (change function name in comments) - rust-lang#119790 (Fix all_trait* methods to return all traits available in StableMIR) - rust-lang#119803 (Silence some follow-up errors [1/x]) - rust-lang#119804 (Stabilize mutex_unpoison feature) - rust-lang#119832 (Meta: Add project const traits to triagebot config) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#119006 - jstasiak:fix-special-ip-ranges, r=cuviper Fix is_global special address handling IANA explicitly documents 192.0.0.9/32, 192.0.0.9/32 and 2001:30::/28 as globally reachable[1][2] and the is_global implementations declare following IANA so let's make this happen. In case of 2002::/16 IANA says N/A so I think it's safe to say we shouldn't return true from is_global for addresses in that block. [1] https://www.iana.org/assignments/iana-ipv4-special-registry/iana-ipv4-special-registry.xhtml [2] https://www.iana.org/assignments/iana-ipv6-special-registry/iana-ipv6-special-registry.xhtml
IANA explicitly documents 192.0.0.9/32, 192.0.0.9/32 and 2001:30::/28 as globally reachable[1][2] and the is_global implementations declare following IANA so let's make this happen.
In case of 2002::/16 IANA says N/A so I think it's safe to say we shouldn't return true from is_global for addresses in that block.
[1] https://www.iana.org/assignments/iana-ipv4-special-registry/iana-ipv4-special-registry.xhtml
[2] https://www.iana.org/assignments/iana-ipv6-special-registry/iana-ipv6-special-registry.xhtml