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

valid? does not correctly validate ipv4 subnet #110

Open
dstull opened this issue Jan 21, 2019 · 3 comments
Open

valid? does not correctly validate ipv4 subnet #110

dstull opened this issue Jan 21, 2019 · 3 comments

Comments

@dstull
Copy link

dstull commented Jan 21, 2019

expect the below to return true as per(https://github.com/ipaddress-gem/ipaddress/blob/master/lib/ipaddress.rb#L111) and does not:

IPAddress::valid? "10.0.0.0/24"
=> false

ipaddress rev: ipaddress (0.8.3)

ruby version 2.3.7

@dstull
Copy link
Author

dstull commented Jan 21, 2019

nevermind - i see it on master, but no one seems to be maintaining the project anymore to push a new release

@Adam21e
Copy link

Adam21e commented Feb 4, 2019

If you are interested in I have forked this into a new repo and gem:
https://github.com/ipaddress2-gem/ipaddress_2

@dstull
Copy link
Author

dstull commented Feb 5, 2019

Good idea!

jivdhaliwal pushed a commit to ministryofjustice/staff-device-dns-dhcp-admin that referenced this issue Aug 24, 2020
The ipaddress_2 gem includes fixes that have been sitting in the master branch
of ipaddress_2 for years without a gem release. Specifically the issue of valid?
not validating ipv4 subnets correctly (ipaddress-gem/ipaddress#110)

In the ipaddress gem you get the following

IPAddress::valid? "10.0.0.0/24"
=> false

But in ipaddress_2 this has been resolved and you get

IPAddress::valid? "10.0.0.0/24"
=> true

ipaddress-gem/ipaddress#117
jivdhaliwal pushed a commit to ministryofjustice/staff-device-dns-dhcp-admin that referenced this issue Aug 24, 2020
The ipaddress_2 gem includes fixes that have been sitting in the master branch
of ipaddress_2 for years without a gem release. Specifically the issue of valid?
not validating ipv4 subnets correctly (ipaddress-gem/ipaddress#110)

In the ipaddress gem you get the following

IPAddress::valid? "10.0.0.0/24"
=> false

But in ipaddress_2 this has been resolved and you get

IPAddress::valid? "10.0.0.0/24"
=> true

ipaddress-gem/ipaddress#117
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants