ipaddr icon indicating copy to clipboard operation
ipaddr copied to clipboard

A class to manipulate an IP address

Results 18 ipaddr issues
Sort by recently updated
recently updated
newest added

Not sure if it is intended behaviour, but IPAddr.new('10.0.0.0/16') == IPAddr.new('10.0.0.0/8') is true, when these are not the same network. The test should be def ==(value) @addr == value.addr &&...

This pull request will fix issue #60. Fix to use the `addr` variable that exists instead of the non-existent `@addr`.

The private? function doesn't recognize the RFC6598 "shared address space", which is basically a new(ish) version of the well known 192.168/16, 172.16/12, and 10./8 spaces. The new space is 100.64.0.0/10....

This behavior caught me by surprise: ```ruby > ip = IPAddr.new('1.2.3.4/16') => # > ip.to_s => "1.2.0.0" ``` Looking at the code I believe this is happening at https://github.com/ruby/ipaddr/blob/master/lib/ipaddr.rb#L649-L651, which...

Given this C program: ```c #include #include #include #include int main(int argc, char * argv[]) { struct ipv6_mreq req; memset(&req, 0, sizeof(req)); req.ipv6mr_multiaddr.s6_addr[0] = 0xFF; req.ipv6mr_multiaddr.s6_addr[1] = 0x02; req.ipv6mr_multiaddr.s6_addr[15] =...

Calling `native` leaves the internal `@mask_addr` as its ipv6 mask instead of converting it to an ipv4 mask. This is most easily seen when calling `prefix`, but also breaks `to_range`...

If the given address is an IPv6 literal enclosed in brackets and/or with a zone ID suffix, it will be unexpectedly accepted. All the following invocations expect AddressFamilyError. ``` %...

After changes from https://github.com/ruby/ipaddr/pull/16 and removing of ``` rescue InvalidAddressError => e raise e.class, "#{e.message}: #{addr}" ``` exception no longer returns proper exception message with invalid ip address. ruby 3.0...

Prior to this commit there was no way to retrieve the unmasked address for an `IPAddr`. For example, given the `IPAddr` below there is no method or instance variable that...

When converting IPv4 to/from IPv6, `IPAddr#set` generates incorrect mask value. This causes `IPAddr#include?` returns incorrect result. ```ruby ip4 = IPAddr.new('::ffff:127.0.0.1').native p [ip4.to_s, ip4.prefix] ip6 = IPAddr.new('127.0.0.1').ipv4_mapped p [ip6.to_s, ip6.prefix] ```...

bug