ipv4 abbreviation not supported #20

Open
ghost opened this Issue May 13, 2012 · 1 comment

Projects

None yet

2 participants

@ghost

IPAddress::valid_ipv4? '10.1'
=> false

$ ping 10.1
PING 10.1 (10.0.0.1): 56 data bytes

to be honest, not that critical, but still for completenes...

@mikerodrigues

I'm interested in implementing this, it seems to be a rather interesting topic: http://superuser.com/questions/486788/why-does-pinging-192-168-072-only-2-dots-return-a-response-from-192-168-0-58

[17] pry(main)> IPAddress.parse("192.168.072").to_s
ArgumentError: Invalid IP "192.168.072"

Should return "192.168.0.58"

[2] pry(main)> IPAddress.parse("192.168.0.072").to_s
=> "192.168.0.072"

Should also return "192.168.0.58"

At least that's how they're interpreted when testing with ping on linux.

I realize it's a different case than what ghost was talking about, but both would be nice towards the goal of completeness with regards to parsing.

@mikemackintosh mikemackintosh self-assigned this Mar 26, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment