-
Notifications
You must be signed in to change notification settings - Fork 98
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
Zero prefix considered invalid for IPv6 #38
Comments
That is a valid route entry. Is it a valid ip address? In the case of ipv4 it isn't. |
Huh. On the flip side Prefix32 does not appear to be consistent Prefix128 since it does allow the 0. |
Good point. |
Sure, its pretty useful when handling route addresses. Thank you. |
As an address it would be ::/128 - and that is defined as the 'Unspecified Address' |
That's correct. ::/128 is indeed the unspecified address. The ::/0 address is used as the default unicast route address. See section 2.11 of RFC 5156. |
I agree with the statement, but is is an 'Address', as it cannot be assigned to / configured on an interface. It probably makes no difference, and maybe should be included for completeness. |
I would like to poke this bug and get some attention to it (if it has not been fixed already). I have a Cisco config snippit like this....
Now I understand how that looks weird but when a big vendor uses /0 on an IP (4 or 6) one might as well consider it a standard. Can we get this fixed? |
@jjmanzer: I can take a look at this. Can you help me understand more about what the use case is for supporting this? There are operations that IPAddress does that will make no sense whatsoever on a 0 address... e.g. hosts, broadcast, etc... What are the functions we are interested in? netmask? |
Sorry, my bad. I said I would have taken care of it but it completely @francisluong I'll need your precious help to review my rusty ruby before
|
@bluemonk I'm in! |
So a quick reason on why you would see this use case is that 0.0.0.0/0 and 0::/0 are used to say 'match every possible route'. You would not see this kind of IP bound to a network interface but instead see it elsewhere in a device's running config somewhere near the routing directives. So not every call to the ipaddress gem is for an actual host IP, sometimes it is for less common things like this. For example, we could have a filter that allows any route that is /32 only. |
When trying to create an IPAddress object for the IPv6 address ::/0 the following error occur:
ArgumentError: Prefix must be in range 1..128, got: 0
This is a result of a check done at line 217 of ipaddress/prefix.rb file.
The address ::/0 is a special case of an IPv6 address and should be considered a valid IPv6 address representation. See: http://en.wikipedia.org/wiki/IPv6_address#Default_route
The text was updated successfully, but these errors were encountered: