summaryrefslogtreecommitdiff
path: root/ext/socket/raddrinfo.c
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-02-15 11:30:19 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-02-15 11:30:19 +0000
commite41b789c9980e2ae4bdb9d320a498e8529524dec (patch)
treed2485790588f10744d390e51a69cba110067db11 /ext/socket/raddrinfo.c
parent140934c6611e77d7c1e0ce9f30e8861a20cc32ca (diff)
* ext/socket/sockport.h (SET_SIN_LEN): defined for strict-aliasing
rule. (INIT_SOCKADDR_IN): ditto. * ext/socket/raddrinfo.c (make_inetaddr): use INIT_SOCKADDR_IN. (addrinfo_ipv6_to_ipv4): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39254 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/socket/raddrinfo.c')
-rw-r--r--ext/socket/raddrinfo.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/socket/raddrinfo.c b/ext/socket/raddrinfo.c
index e8955d7..067be4f 100644
--- a/ext/socket/raddrinfo.c
+++ b/ext/socket/raddrinfo.c
@@ -253,7 +253,7 @@ make_inetaddr(unsigned int host, char *buf, size_t buflen)
{
struct sockaddr_in sin;
- INIT_SOCKADDR((struct sockaddr *)&sin, AF_INET, sizeof(sin));
+ INIT_SOCKADDR_IN(&sin, AF_INET, sizeof(sin));
sin.sin_addr.s_addr = host;
make_ipaddr0((struct sockaddr*)&sin, sizeof(sin), buf, buflen);
}
@@ -1929,7 +1929,7 @@ addrinfo_ipv6_to_ipv4(VALUE self)
addr = &((struct sockaddr_in6 *)&rai->addr)->sin6_addr;
if (IN6_IS_ADDR_V4MAPPED(addr) || IN6_IS_ADDR_V4COMPAT(addr)) {
struct sockaddr_in sin4;
- INIT_SOCKADDR((struct sockaddr *)&sin4, AF_INET, sizeof(sin4));
+ INIT_SOCKADDR_IN(&sin4, AF_INET, sizeof(sin4));
memcpy(&sin4.sin_addr, (char*)addr + sizeof(*addr) - sizeof(sin4.sin_addr), sizeof(sin4.sin_addr));
return rsock_addrinfo_new((struct sockaddr *)&sin4, (socklen_t)sizeof(sin4),
PF_INET, rai->socktype, rai->protocol,