summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorEspartaco Palma <git@esparta.co>2021-12-13 01:12:07 -0800
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2022-02-10 17:18:05 +0900
commit9b768012f6bf5b5896d2d34feb69605d4ccc9ca3 (patch)
treefdc207e902f30614ed3556e78de9eb06cb43c474 /lib
parent100253c7f0f4d105ae88340a0314506cde69cfd2 (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.rb3
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