diff options
author | Espartaco Palma <[email protected]> | 2021-12-13 01:12:07 -0800 |
---|---|---|
committer | Hiroshi SHIBATA <[email protected]> | 2022-02-10 17:18:05 +0900 |
commit | 9b768012f6bf5b5896d2d34feb69605d4ccc9ca3 (patch) | |
tree | fdc207e902f30614ed3556e78de9eb06cb43c474 /lib | |
parent | 100253c7f0f4d105ae88340a0314506cde69cfd2 (diff) |
[ruby/ipaddr] Fix exception calling `to_range' after `freeze'
https://github.com/ruby/ipaddr/commit/77fe1fca0a
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ipaddr.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/ipaddr.rb b/lib/ipaddr.rb index 51ad081e23..c33302ce05 100644 --- a/lib/ipaddr.rb +++ b/lib/ipaddr.rb @@ -411,7 +411,7 @@ class IPAddr raise AddressFamilyError, "unsupported address family" end - return clone.set(begin_addr, @family)..clone.set(end_addr, @family) + self.class.new(begin_addr, @family)..self.class.new(end_addr, @family) end # Returns the prefix length in bits for the ipaddr. @@ -583,6 +583,7 @@ class IPAddr # those, such as &, |, include? and ==, accept a string, or a packed # in_addr value instead of an IPAddr object. def initialize(addr = '::', family = Socket::AF_UNSPEC) + @mask_addr = nil if !addr.kind_of?(String) case family when Socket::AF_INET, Socket::AF_INET6 |