summaryrefslogtreecommitdiff
path: root/ext/socket/extconf.rb
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-02-19 10:37:43 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-02-19 10:37:43 +0000
commit2e6b97a45d077979121b29484a8831034d47ef50 (patch)
treebb94b8e14405cd8101f11b69d5ba29d8697b1128 /ext/socket/extconf.rb
parentdd1c3a75096b97c1ebcb8597c001761ddfb3c1bf (diff)
* ext/socket: Bypass getaddrinfo() if node and serv are numeric.
Reporeted by Naotoshi Seo. [ruby-core:60801] [Bug #9525] * ext/socket/extconf.rb: Detect struct sockaddr_in6.sin6_len. * ext/socket/sockport.h (SET_SIN6_LEN): New macro. (INIT_SOCKADDR_IN6): Ditto. * ext/socket/rubysocket.h (struct rb_addrinfo): Add allocated_by_malloc field. * ext/socket/raddrinfo.c (numeric_getaddrinfo): New function. (rb_getaddrinfo): Call numeric_getaddrinfo at first. (rb_freeaddrinfo): Free struct addrinfo properly when it is allocated by numeric_getaddrinfo. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45047 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/socket/extconf.rb')
-rw-r--r--ext/socket/extconf.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/ext/socket/extconf.rb b/ext/socket/extconf.rb
index f3be586..6c61324 100644
--- a/ext/socket/extconf.rb
+++ b/ext/socket/extconf.rb
@@ -332,6 +332,7 @@ end
have_struct_member("struct sockaddr", "sa_len", headers) # 4.4BSD
have_struct_member("struct sockaddr_in", "sin_len", headers) # 4.4BSD
+have_struct_member("struct sockaddr_in6", "sin6_len", headers) # 4.4BSD
if have_type("struct sockaddr_un", headers) # POSIX
have_struct_member("struct sockaddr_un", "sun_len", headers) # 4.4BSD