summaryrefslogtreecommitdiff
path: root/ext/socket/rubysocket.h
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-07-20 00:32:35 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-07-20 00:32:35 +0000
commit3efea48a70180aa981011a79d9a8d07d520f4321 (patch)
tree85c95006736d98cd8c0f8d4e95af4697d6ff5d02 /ext/socket/rubysocket.h
parentb1a0509b5465ce77f52e0384159237889a8d60ec (diff)
* ext/socket/raddrinfo.c (addrinfo_ipv6_unique_local_p): Added
Addrinfo#ipv6_unique_local? to detect RFC 4193 unique local addresses. Part of #6692 * ext/socket/rubysocket.h: Add IN6_IS_ADDR_UNIQUE_LOCAL macro if missing. * test/socket/test_addrinfo.rb: Test for ipv6_unqiue_local? git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36474 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/socket/rubysocket.h')
-rw-r--r--ext/socket/rubysocket.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/socket/rubysocket.h b/ext/socket/rubysocket.h
index bbc8249..33cb51a 100644
--- a/ext/socket/rubysocket.h
+++ b/ext/socket/rubysocket.h
@@ -117,6 +117,10 @@
# define IS_IP_FAMILY(af) ((af) == AF_INET)
#endif
+#ifndef IN6_IS_ADDR_UNIQUE_LOCAL
+# define IN6_IS_ADDR_UNIQUE_LOCAL(a) (((a)->s6_addr[0] == 0xfc) || ((a)->s6_addr[0] == 0xfd))
+#endif
+
#ifndef HAVE_SOCKADDR_STORAGE
/*
* RFC 2553: protocol-independent placeholder for socket addresses