Feature #11666 closed
Accepted. But we have naming issue. private?
or private_addr?
or something else?
Any comments?
Matz.
I think private? is better than private_addr? because private_addr? seems to be redundant in following code:
IPAddr . new ( "192.168.1.1" ). private_addr?
Status changed from Open to Assigned
Assignee changed from Glass_saga (Masaki Matsushita) to knu (Akinori MUSHA)
The maintainer is knu.
feature issues
conflict with private visibility
“private?” is different from visivility
Behavior when address family is IPv6
nil? false?
or treat link-local, site-local (deprecated), unique-local as true?
Naming differencies with Addrinfo
The name “ipv4_private?” is clear that the method returns false on IPv6 addresses.
As far as I understand RFC4193 never defines its range being "private". There also are other private-ish address ranges e.g. fd00::/8. And what about v4-mapped v6 addresses? IPv6's situation is complicated (at least to me). I'd suggest OP to leave IPv6 situations untouched.
Has duplicate Feature #10912 : Add method(s) to IPAddr for determining whether an address is link local added
Status changed from Assigned to Closed
Applied in changeset trunk|r60270.
Import ipaddr 1.2.0
Add IPAddr#prefix
Add IPAddr#loopback?
Add IPAddr#private? [Feature #11666 ]
Add IPAddr#link_local? [Feature #10912 ]
Reject invalid address mask [Bug #13399 ]
Warn that IPAddr#ipv4_compat and #ipv4_compat? are deprecated [#Bug 13769]
Added, thanks for the suggestion.
Also available in: Atom
PDF
Like 0
Like 0 Like 0 Like 0 Like 0 Like 0 Like 0 Like 0 Like 0