summaryrefslogtreecommitdiff
path: root/ext/socket/ancdata.c
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-02-14 23:14:22 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-02-14 23:14:22 +0000
commit1ff7108306f63b1f5cc9b0ed2d376f5a1f99bdf4 (patch)
treee6311f2f125a7bb6cf043e67dee4cf3e0ea02eb5 /ext/socket/ancdata.c
parentdfbb5b677c1b293e0177bc99b2d7dcf24e87453d (diff)
* ext/socket/sockport.h (SET_SS_LEN): removed.
(SET_SIN_LEN): removed. (INIT_SOCKADDR): new macro. * ext/socket/ancdata.c (extract_ipv6_pktinfo): use INIT_SOCKADDR. * ext/socket/raddrinfo.c (make_inetaddr): use INIT_SOCKADDR. (addrinfo_ipv6_to_ipv4): ditto. * ext/socket/getaddrinfo.c (GET_AI): use INIT_SOCKADDR. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39248 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/socket/ancdata.c')
-rw-r--r--ext/socket/ancdata.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/ext/socket/ancdata.c b/ext/socket/ancdata.c
index 050da97..fa794eb 100644
--- a/ext/socket/ancdata.c
+++ b/ext/socket/ancdata.c
@@ -573,9 +573,7 @@ extract_ipv6_pktinfo(VALUE self, struct in6_pktinfo *pktinfo_ptr, struct sockadd
memcpy(pktinfo_ptr, RSTRING_PTR(data), sizeof(*pktinfo_ptr));
- memset(sa_ptr, 0, sizeof(*sa_ptr));
- SET_SA_LEN((struct sockaddr *)sa_ptr, sizeof(struct sockaddr_in6));
- sa_ptr->sin6_family = AF_INET6;
+ INIT_SOCKADDR((struct sockaddr *)sa_ptr, AF_INET6, sizeof(*sa_ptr));
memcpy(&sa_ptr->sin6_addr, &pktinfo_ptr->ipi6_addr, sizeof(sa_ptr->sin6_addr));
if (IN6_IS_ADDR_LINKLOCAL(&sa_ptr->sin6_addr))
sa_ptr->sin6_scope_id = pktinfo_ptr->ipi6_ifindex;