From bbcf97fad6408739a945b1452f9bcb05b2d08755 Mon Sep 17 00:00:00 2001 From: naruse Date: Tue, 7 May 2013 22:51:16 +0000 Subject: [PATCH] * 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::: for link-local address internally. Setting sin6_scope_id causes it leaked. see also comments of sockaddr_obj(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40603 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 9 +++++++++ ext/socket/socket.c | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index b6ae703735..8aabf6d22f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +Wed May 8 06:42:56 2013 NARUSE, Yui + + * 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::: 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 * ext/readline/readline.c (insert_ignore_escape): Add a cast to diff --git a/ext/socket/socket.c b/ext/socket/socket.c index 43bff85737..8172ae4ddb 100644 --- a/ext/socket/socket.c +++ b/ext/socket/socket.c @@ -1658,7 +1658,7 @@ socket_s_ip_address_list(VALUE self) 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.