ruby-changes:63554
From: Kazuhiro <ko1@a...>
Date: Mon, 9 Nov 2020 16:19:24 +0900 (JST)
Subject: [ruby-changes:63554] d14397bcc4 (master): `fe80` should be case insensitive too
https://git.ruby-lang.org/ruby.git/commit/?id=d14397bcc4 From d14397bcc48b73070953c9fbd410ba435e5f4b8c Mon Sep 17 00:00:00 2001 From: Kazuhiro NISHIYAMA <zn@m...> Date: Mon, 9 Nov 2020 16:16:30 +0900 Subject: `fe80` should be case insensitive too diff --git a/lib/resolv.rb b/lib/resolv.rb index dd0a959..3ca0f01 100644 --- a/lib/resolv.rb +++ b/lib/resolv.rb @@ -2462,7 +2462,7 @@ class Resolv https://github.com/ruby/ruby/blob/trunk/lib/resolv.rb#L2462 ## # IPv6 link local address format fe80:b:c:d:e:f:g:h%em1 Regex_8HexLinkLocal = /\A - fe80 + [Ff][Ee]80 (?::[0-9A-Fa-f]{1,4}){7} %[0-9A-Za-z]+ \z/x @@ -2471,7 +2471,7 @@ class Resolv https://github.com/ruby/ruby/blob/trunk/lib/resolv.rb#L2471 # Compressed IPv6 link local address format fe80::b%em1 Regex_CompressedHexLinkLocal = /\A - fe80: + [Ff][Ee]80: (?: ((?:[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4})*)?) :: ((?:[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4})*)?) diff --git a/test/resolv/test_addr.rb b/test/resolv/test_addr.rb index e72d4ee..6209267 100644 --- a/test/resolv/test_addr.rb +++ b/test/resolv/test_addr.rb @@ -25,6 +25,9 @@ class TestResolvAddr < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/resolv/test_addr.rb#L25 assert_match(Resolv::IPv6::Regex, "fe80:2:3:4:5:6:7:8%em1", bug17112) assert_match(Resolv::IPv6::Regex, "fe80::20d:3aff:fe7d:9760%eth0", bug17112) assert_match(Resolv::IPv6::Regex, "fe80::1%em1", bug17112) + assert_match(Resolv::IPv6::Regex, "FE80:2:3:4:5:6:7:8%EM1", bug17112) + assert_match(Resolv::IPv6::Regex, "FE80::20D:3AFF:FE7D:9760%ETH0", bug17112) + assert_match(Resolv::IPv6::Regex, "FE80::1%EM1", bug17112) end def test_valid_socket_ip_address_list -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/