[#39052] Fwd: [redmine4ruby-lang:253] [Bug #1914] ruby-1.9.1-p243 failed to build from source on aix 5.3 with gcc 4.2.0 — Yugui <yugui@...>

Redmine管理用プロジェクトに報告されてしまったので転送します。

12 messages 2009/08/09
[#39264] Re: Fwd: [redmine4ruby-lang:253] [Bug #1914] ruby-1.9.1-p243 failed to build from source on aix 5.3 with gcc 4.2.0 — Yutaka Kanemoto <kinpoco@...> 2009/09/08

金本と申します。

[#39107] [Bug #1952] cannot stop with Ctrl+C — Usaku NAKAMURA <redmine@...>

Bug #1952: cannot stop with Ctrl+C

14 messages 2009/08/18

[#39167] [Bug #2000] Change the license to "GPLv2+ or Ruby's original". — Mamoru Tasaka <redmine@...>

Bug #2000: Change the license to "GPLv2+ or Ruby's original".

11 messages 2009/08/26

[#39193] Re: [ruby-cvs:31917] Ruby:r24699 (trunk): * lib/tmpdir.rb (Dir.mktmpdir): removed thread race condition. — Tanaka Akira <akr@...>

In article <200908281827.n7SIRbaX003476@ci.ruby-lang.org>,

16 messages 2009/08/29
[#39194] Re: [ruby-cvs:31917] Ruby:r24699 (trunk): * lib/tmpdir.rb (Dir.mktmpdir): removed thread race condition. — Nobuyoshi Nakada <nobu@...> 2009/08/29

なかだです。

[#39195] Re: [ruby-cvs:31917] Ruby:r24699 (trunk): * lib/tmpdir.rb (Dir.mktmpdir): removed thread race condition. — Tanaka Akira <akr@...> 2009/08/29

In article <4a988633.9553f10a.4496.483e@mx.google.com>,

[#39196] Re: [ruby-cvs:31917] Ruby:r24699 (trunk): * lib/tmpdir.rb (Dir.mktmpdir): removed thread race condition. — Nobuyoshi Nakada <nobu@...> 2009/08/29

なかだです。

[#39197] Re: [ruby-cvs:31917] Ruby:r24699 (trunk): * lib/tmpdir.rb (Dir.mktmpdir): removed thread race condition. — Tanaka Akira <akr@...> 2009/08/29

In article <4a989f76.1602be0a.3de4.1131@mx.google.com>,

[#39198] Re: [ruby-cvs:31917] Ruby:r24699 (trunk): * lib/tmpdir.rb (Dir.mktmpdir): removed thread race condition. — Yukihiro Matsumoto <matz@...> 2009/08/29

まつもと ゆきひろです

[#39206] Re: [ruby-cvs:31917] Ruby:r24699 (trunk): * lib/tmpdir.rb (Dir.mktmpdir): removed thread race condition. — Nobuyoshi Nakada <nobu@...> 2009/08/31

なかだです。

[ruby-dev:39011] [Feature:1.9] IPAddr#hash should consider a mask_addr

From: Nobuhiro IMAI <nov@...>
Date: 2009-08-04 13:26:06 UTC
List: ruby-dev #39011
いまいです。

r24388 ですが、ネットマスクが考慮されていないので、アドレスが同じでネッ
トマスクが違うオブジェクトも同じものだとみなされてしまいます。

>> a1 = IPAddr.new("192.168.2.0/24")
=> #<IPAddr: IPv4:192.168.2.0/255.255.255.0>
>> a2 = IPAddr.new("192.168.2.0/25")
=> #<IPAddr: IPv4:192.168.2.0/255.255.255.128>
>> {a1 => 'ipv4', a2 => 'ipv4'}.size
=> 1

これらは別の範囲を指すオブジェクトだと思うので、ハッシュのキーとしては
別のものであるとうれしいです。とりあえずパッチです。
--
Nobuhiro IMAI <nov@yo.rim.or.jp>
Key fingerprint = F39E D552 545D 7C64 D690  F644 5A15 746C BD8E 7106


Index: lib/ipaddr.rb
===================================================================
--- lib/ipaddr.rb	(revision 24388)
+++ lib/ipaddr.rb	(working copy)
@@ -338,7 +338,7 @@
 
   # Returns a hash value used by Hash, Set, and Array classes
   def hash
-    return (@addr.hash << 1) | (ipv4? ? 0 : 1)
+    return ([@addr, @mask_addr].hash << 1) | (ipv4? ? 0 : 1)
   end
 
   # Creates a Range object for the network address.
@@ -827,17 +827,19 @@
     a4 = IPAddr.new('3ffe:505:2::1')
     a5 = IPAddr.new('127.0.0.1')
     a6 = IPAddr.new('::1')
+    a7 = IPAddr.new('192.168.2.0/25')
+    a8 = IPAddr.new('192.168.2.0/25')
 
-    h = { a1 => 'ipv4', a2 => 'ipv4', a3 => 'ipv6', a4 => 'ipv6', a5 => 'ipv4', a6 => 'ipv6' }
-    assert_equal(4, h.size)
+    h = { a1 => 'ipv4', a2 => 'ipv4', a3 => 'ipv6', a4 => 'ipv6', a5 => 'ipv4', a6 => 'ipv6', a7 => 'ipv4', a8 => 'ipv4'}
+    assert_equal(5, h.size)
     assert_equal('ipv4', h[a1])
     assert_equal('ipv4', h[a2])
     assert_equal('ipv6', h[a3])
     assert_equal('ipv6', h[a4])
 
     require 'set'
-    s = Set[a1, a2, a3, a4, a5, a6]
-    assert_equal(4, s.size)
+    s = Set[a1, a2, a3, a4, a5, a6, a7, a8]
+    assert_equal(5, s.size)
     assert_equal(true, s.include?(a1))
     assert_equal(true, s.include?(a2))
     assert_equal(true, s.include?(a3))

In This Thread

Prev Next