mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/resolv.rb (Resolv::IPv6.create): avoid modifying frozen * test/resolv/test_dns.rb (test_ipv6_create): test for above [Bug #11910] [ruby-core:72559] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@54404 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
337a3da71c
commit
6b2f77a844
4 changed files with 18 additions and 6 deletions
|
@ -1,3 +1,9 @@
|
|||
Tue Mar 29 22:56:44 2016 Eric Wong <e@80x24.org>
|
||||
|
||||
* lib/resolv.rb (Resolv::IPv6.create): avoid modifying frozen
|
||||
* test/resolv/test_dns.rb (test_ipv6_create): test for above
|
||||
[Bug #11910] [ruby-core:72559]
|
||||
|
||||
Tue Mar 29 22:31:48 2016 Shugo Maeda <shugo@ruby-lang.org>
|
||||
|
||||
* range.c (range_eqq): revert r11113 because rb_call_super() is
|
||||
|
|
|
@ -2451,14 +2451,14 @@ class Resolv
|
|||
when IPv6
|
||||
return arg
|
||||
when String
|
||||
address = ''
|
||||
address = ''.b
|
||||
if Regex_8Hex =~ arg
|
||||
arg.scan(/[0-9A-Fa-f]+/) {|hex| address << [hex.hex].pack('n')}
|
||||
elsif Regex_CompressedHex =~ arg
|
||||
prefix = $1
|
||||
suffix = $2
|
||||
a1 = ''
|
||||
a2 = ''
|
||||
a1 = ''.b
|
||||
a2 = ''.b
|
||||
prefix.scan(/[0-9A-Fa-f]+/) {|hex| a1 << [hex.hex].pack('n')}
|
||||
suffix.scan(/[0-9A-Fa-f]+/) {|hex| a2 << [hex.hex].pack('n')}
|
||||
omitlen = 16 - a1.length - a2.length
|
||||
|
@ -2474,8 +2474,8 @@ class Resolv
|
|||
elsif Regex_CompressedHex4Dec =~ arg
|
||||
prefix, suffix, a, b, c, d = $1, $2, $3.to_i, $4.to_i, $5.to_i, $6.to_i
|
||||
if (0..255) === a && (0..255) === b && (0..255) === c && (0..255) === d
|
||||
a1 = ''
|
||||
a2 = ''
|
||||
a1 = ''.b
|
||||
a2 = ''.b
|
||||
prefix.scan(/[0-9A-Fa-f]+/) {|hex| a1 << [hex.hex].pack('n')}
|
||||
suffix.scan(/[0-9A-Fa-f]+/) {|hex| a2 << [hex.hex].pack('n')}
|
||||
omitlen = 12 - a1.length - a2.length
|
||||
|
|
|
@ -199,6 +199,12 @@ class TestResolvDNS < Test::Unit::TestCase
|
|||
assert_equal(expected, labels)
|
||||
end
|
||||
|
||||
def test_ipv6_create
|
||||
ref = '[Bug #11910] [ruby-core:72559]'
|
||||
assert_instance_of Resolv::IPv6, Resolv::IPv6.create('::1')
|
||||
assert_instance_of Resolv::IPv6, Resolv::IPv6.create('::1:127.0.0.1')
|
||||
end
|
||||
|
||||
def test_too_big_label_address
|
||||
n = 2000
|
||||
m = Resolv::DNS::Message::MessageEncoder.new {|msg|
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#define RUBY_VERSION "2.3.0"
|
||||
#define RUBY_RELEASE_DATE "2016-03-29"
|
||||
#define RUBY_PATCHLEVEL 52
|
||||
#define RUBY_PATCHLEVEL 53
|
||||
|
||||
#define RUBY_RELEASE_YEAR 2016
|
||||
#define RUBY_RELEASE_MONTH 3
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue