You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Net::Works::Address->new_from_integer(integer => '42540766416916187176308156905784606720') returns the address for 255.255.255.255 rather than 2001:db8:1234::
The text was updated successfully, but these errors were encountered:
Make the passed value a uint128() and then check if it's in the IPv4 or IPv6 range - we still need need to make sure it's a valid uint128 - the uint128() sub appears to return 0 on an invalid number, so we can check the uint128()'d number against the original string version for equality. If they're not equal it's not valid.
Require an explicit version param
Either way, the current code's method of determining whether something is an IPv4 or IPv6 number is not very smart.
@2shortplanks ran into a related problem with trying to pass in a Math::UInt128 integer for an IPv4 network, causing much confusion. Either of these solutions would also fix that issue.
Net::Works::Address->new_from_integer(integer => '42540766416916187176308156905784606720')
returns the address for255.255.255.255
rather than2001:db8:1234::
The text was updated successfully, but these errors were encountered: