Issue #11666 has been updated by Herwin W.


IPv6 has a private range too: d00::/8 (RFC 4193)

Also, there are more IP ranges that have been reserved for special use (there's an overview on https://en.wikipedia.org/wiki/Reserved_IP_addresses). I think it would be better to make 1 method that can return a pre-defined symbol of that range if the IP address is in that range. Otherwise, there would be an explosion in the number of IP addresses.

----------------------------------------
Feature #11666: IPAddr#private?
https://bugs.ruby-lang.org/issues/11666#change-57166

* Author: Masaki Matsushita
* Status: Assigned
* Priority: Normal
* Assignee: Akinori MUSHA
----------------------------------------
I propose a new feature: IPAddr#private?.

Example:

```ruby
IPAddr.new("192.168.1.1").private? #=> true.
```

---Files--------------------------------
patch.diff (1.58 KB)


-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>