summaryrefslogtreecommitdiff
path: root/lib/ipaddr.rb
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-10-23 07:35:14 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-10-23 07:35:14 +0000
commit2cd1f852e1404462f97a49856b1984d5dd49badc ()
treef18e3bac0b90cfc8c4b6dd89306479c5cacd9d17 /lib/ipaddr.rb
parent2697fb4990935d7e6432ef2e142c03d7383264da (diff)
* lib/ipaddr.rb, test/test_ipaddr.rb: Reject invalid address contained
EOL string. by @kachick [fix GH-942][Bug #11513] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52244 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--lib/ipaddr.rb4
1 files changed, 2 insertions, 2 deletions
@@ -410,7 +410,7 @@ class IPAddr
# Set current netmask to given mask.
def mask!(mask)
if mask.kind_of?(String)
- if mask =~ /^\d+$/
prefixlen = mask.to_i
else
m = IPAddr.new(mask)
@@ -478,7 +478,7 @@ class IPAddr
end
end
prefix, prefixlen = addr.split('/')
- if prefix =~ /^\[(.*)\]$/i
prefix = $1
family = Socket::AF_INET6
end