Comments (2)
I can see a case for the current code being right, in that they are the same ping-able IP address.
The problem is that IPAddr is trying to be both a representation of a network, and of a single IP address. It might be better to have an IPNet class that inherits from the IPAddr class, and check the masks in the IPNet case, and not the IPAddr case.
include? would be an interesting case, in that it could be checking that the IPAddr is in an IPNet, or it could check that an IPNet is a subnet of another IPNet (the argument's mask <= instance's mask)
from ipaddr.
Related issues in Ruby Issue Tracking System.
from ipaddr.
Related Issues (14)
- Exception on valid link-local ipv6 address HOT 2
- #native results in incorrect mask, breaking #prefix HOT 2
- CIDR parsing ignores part after second slash HOT 1
- `IPAddr#freeze` is broken HOT 6
- IPAddr.new accepts invalid IPv6 addresses HOT 6
- Proposal to add subnet information to the to_string method. HOT 2
- unsupported address family HOT 2
- Wrong InvalidAddressError message HOT 1
- IPAddr.new accepts certain IPv6 literals when AF_INET is specified
- IPv6 hton layout does not match ipv6_mreq HOT 1
- Allow reading unmasked address when passed a CIDR string
- RFC6598 addresses not recognized as private
- CI: Builds fail due to 2.4, 2.5 can't run latest macOS
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ipaddr.