Skip to content
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

Missing a private address range | 100.64.0.0/10 #91084

Closed
gregorst3 opened this issue Nov 20, 2021 · 2 comments
Closed

Missing a private address range | 100.64.0.0/10 #91084

gregorst3 opened this issue Nov 20, 2021 · 2 comments
Labels
A-io Area: `std::io`, `std::fs`, `std::net` and `std::path` C-bug Category: This is a bug. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Comments

@gregorst3
Copy link

gregorst3 commented Nov 20, 2021

Hello, there is a private address range missing from the Ipv4Addr filter:

As per here https://doc.rust-lang.org/beta/src/std/net/ip.rs.html#557-564

 /// The private address ranges are defined in [IETF RFC 1918] and include:
    ///
    ///  - `10.0.0.0/8`
    ///  - `172.16.0.0/12`
    ///  - `192.168.0.0/16`

There is also another private range defined in rfc6598 , the 100.64.0.0/10 range https://datatracker.ietf.org/doc/html/rfc6598 , today some providers are banning the use of it because it's used to deploy carrier-grade NAT (CGN) services.

I run my applications by filtering the use of Ipv4Addr ranges (substrate p2p nodes)... however, because the applications reads Ipv4Addr to filter the ip that doesn't need to be scanned, I receive abuse due to the 100.64.0.0 missing from the filter.

time protocol src_ip src_port dest_ip dest_port
Sun Oct 3 07:59:57 2021 TCP My_IP 42188 => 100.98.83.192 30336
Sun Oct 3 08:00:00 2021 TCP My_IP 42188 => 100.98.83.192 30336
Sun Oct 3 07:59:17 2021 TCP My_IP 46722 => 100.103.178.192 30336
Sun Oct 3 07:59:18 2021 TCP My_IP 46722 => 100.103.178.192 30336
Sun Oct 3 07:59:20 2021 TCP My_IP 46722 => 100.103.178.192 30336
Sun Oct 3 08:08:29 2021 TCP My_IP 52080 => 100.103.178.192 30336
Sun Oct 3 08:08:30 2021 TCP My_IP 52080 => 100.103.178.192 30336

@gregorst3 gregorst3 added the C-bug Category: This is a bug. label Nov 20, 2021
@gregorst3 gregorst3 changed the title Missing one important private address ranges Missing one important private address range | 100.64.0.0/10 Nov 20, 2021
@gregorst3 gregorst3 changed the title Missing one important private address range | 100.64.0.0/10 Missing a private address range | 100.64.0.0/10 Nov 20, 2021
@hkratz
Copy link
Contributor

hkratz commented Nov 20, 2021

Quoting RFC 6598: "Shared Address Space is distinct from RFC 1918 private address space because it is intended for use on Service Provider networks." So is_private() should not return true for those addresses.

There already is Ipv4Addr::is_shared() which returns trueif the IP address is in 100.64.0.0/10. Unfortunately this is currently nightly-only.

CC tracking issues: #27709, #85612

@camelid camelid added A-io Area: `std::io`, `std::fs`, `std::net` and `std::path` T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Nov 20, 2021
@joshtriplett
Copy link
Member

Closing based on the response from @hkratz.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-io Area: `std::io`, `std::fs`, `std::net` and `std::path` C-bug Category: This is a bug. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants