summaryrefslogtreecommitdiff
path: root/ext/socket/extconf.rb
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-12-25 14:35:28 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-12-25 14:35:28 +0000
commit01da08a29c3732abff521bf43ba43050b07cc0ce (patch)
tree020dd6d8807720e3654a42bf0576de51057f0673 /ext/socket/extconf.rb
parentef990446737fc7923aed358e5b2c618a77a12d65 (diff)
* ext/socket/option.c (inspect_ipv4_add_drop_membership): new function
to inspect struct ip_mreq and struct ip_mreqn for IP_ADD_MEMBERSHIP and IP_DROP_MEMBERSHIP. Socket::Option.new(:INET, :IP, :ADD_MEMBERSHIP, [239,255,99,81, 0,0,0,0].pack("CCCCCCCC")).inspect is now "#<Socket::Option: INET IP ADD_MEMBERSHIP 239.255.99.81 0.0.0.0>". (inspect_ipv4_multicast_if): new function to inspect struct in_addr and struct ip_mreqn for IP_MULTICAST_IF. Socket::Option.new(:INET, :IP, :MULTICAST_IF, [192,168,0,7].pack("CCCC")).inspect is now "#<Socket::Option: INET IP MULTICAST_IF 192.168.0.7>". * ext/socket/extconf.rb: check struct ip_mreq and struct ip_mreqn. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30371 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/socket/extconf.rb')
-rw-r--r--ext/socket/extconf.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/ext/socket/extconf.rb b/ext/socket/extconf.rb
index 7e72954..62f3dd9 100644
--- a/ext/socket/extconf.rb
+++ b/ext/socket/extconf.rb
@@ -340,7 +340,9 @@ have_func("getpeereid")
have_header("ucred.h", headers)
have_func("getpeerucred")
-have_type("struct ipv6_mreq", headers)
+have_type("struct ip_mreq", headers) # 4.4BSD
+have_type("struct ip_mreqn", headers) # Linux 2.4
+have_type("struct ipv6_mreq", headers) # RFC 3493
# workaround for recent Windows SDK
$defs << "-DIPPROTO_IPV6=IPPROTO_IPV6" if $defs.include?("-DHAVE_CONST_IPPROTO_IPV6") && !have_macro("IPPROTO_IPV6")