[前][次][番号順一覧][スレッド一覧]

ruby-changes:30122

From: naruse <ko1@a...>
Date: Fri, 26 Jul 2013 05:49:46 +0900 (JST)
Subject: [ruby-changes:30122] naruse:r42174 (trunk): Somehow Debian 6.0.7 needs ifname for IPv6 multicast connect

naruse	2013-07-26 05:49:36 +0900 (Fri, 26 Jul 2013)

  New Revision: 42174

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=42174

  Log:
    Somehow Debian 6.0.7 needs ifname for IPv6 multicast connect

  Modified files:
    trunk/test/rinda/test_rinda.rb

Index: test/rinda/test_rinda.rb
===================================================================
--- test/rinda/test_rinda.rb	(revision 42173)
+++ test/rinda/test_rinda.rb	(revision 42174)
@@ -533,7 +533,7 @@ module RingIPv6 https://github.com/ruby/ruby/blob/trunk/test/rinda/test_rinda.rb#L533
         next unless ifaddr.addr.ipv6_linklocal?
         next if ifaddr.name[0, 2] == "lo"
         r.multicast_interface = ifaddr.ifindex
-        return
+        return ifaddr
       end
     rescue NotImplementedError
       # ifindex() function may not be implemented on Windows.
@@ -663,8 +663,13 @@ class TestRingFinger < Test::Unit::TestC https://github.com/ruby/ruby/blob/trunk/test/rinda/test_rinda.rb#L663
   end
 
   def test_make_socket_ipv6_multicast
-    prepare_ipv6(@rf)
-    v6mc = @rf.make_socket('ff02::1')
+    ifaddr = prepare_ipv6(@rf)
+    begin
+      v6mc = @rf.make_socket("ff02::1")
+    rescue Errno::EINVAL
+      # somehow Debian 6.0.7 needs ifname
+      v6mc = @rf.make_socket("ff02::1%#{ifaddr.name}")
+    end
 
     assert_equal(1, v6mc.getsockopt(:IPPROTO_IPV6, :IPV6_MULTICAST_LOOP).int)
     assert_equal(1, v6mc.getsockopt(:IPPROTO_IPV6, :IPV6_MULTICAST_HOPS).int)
@@ -679,7 +684,12 @@ class TestRingFinger < Test::Unit::TestC https://github.com/ruby/ruby/blob/trunk/test/rinda/test_rinda.rb#L684
   def test_make_socket_ipv6_multicast_hops
     prepare_ipv6(@rf)
     @rf.multicast_hops = 2
-    v6mc = @rf.make_socket('ff02::1')
+    begin
+      v6mc = @rf.make_socket("ff02::1")
+    rescue Errno::EINVAL
+      # somehow Debian 6.0.7 needs ifname
+      v6mc = @rf.make_socket("ff02::1%#{ifaddr.name}")
+    end
     assert_equal(2, v6mc.getsockopt(:IPPROTO_IPV6, :IPV6_MULTICAST_HOPS).int)
   end
 

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]