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

ruby-changes:28551

From: naruse <ko1@a...>
Date: Wed, 8 May 2013 07:51:28 +0900 (JST)
Subject: [ruby-changes:28551] naruse:r40603 (trunk): * ext/socket/socket.c (socket_s_ip_address_list): fix wrongly filled

naruse	2013-05-08 07:51:16 +0900 (Wed, 08 May 2013)

  New Revision: 40603

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

  Log:
    * ext/socket/socket.c (socket_s_ip_address_list): fix wrongly filled
      sin6_scope_id on KAME introduced by r40593 for OpenIndiana.
      KAME uses fe80:<scope_id>::<interface id> for link-local address
      internally.
      Setting sin6_scope_id causes it leaked.
      see also comments of sockaddr_obj().

  Modified files:
    trunk/ChangeLog
    trunk/ext/socket/socket.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 40602)
+++ ChangeLog	(revision 40603)
@@ -1,3 +1,12 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Wed May  8 06:42:56 2013  NARUSE, Yui  <naruse@r...>
+
+	* ext/socket/socket.c (socket_s_ip_address_list): fix wrongly filled
+	  sin6_scope_id on KAME introduced by r40593 for OpenIndiana.
+	  KAME uses fe80:<scope_id>::<interface id> for link-local address
+	  internally.
+	  Setting sin6_scope_id causes it leaked.
+	  see also comments of sockaddr_obj().
+
 Tue May  7 22:12:34 2013  Tanaka Akira  <akr@f...>
 
 	* ext/readline/readline.c (insert_ignore_escape): Add a cast to
Index: ext/socket/socket.c
===================================================================
--- ext/socket/socket.c	(revision 40602)
+++ ext/socket/socket.c	(revision 40603)
@@ -1658,7 +1658,7 @@ socket_s_ip_address_list(VALUE self) https://github.com/ruby/ruby/blob/trunk/ext/socket/socket.c#L1658
     for (p = ifp; p; p = p->ifa_next) {
         if (p->ifa_addr != NULL && IS_IP_FAMILY(p->ifa_addr->sa_family)) {
             struct sockaddr *addr = p->ifa_addr;
-#if defined(AF_INET6)
+#if defined(AF_INET6) && defined(__sun)
             /*
              * OpenIndiana SunOS 5.11 getifaddrs() returns IPv6 link local
              * address with sin6_scope_id == 0.

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

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