summaryrefslogtreecommitdiffstats
path: root/lib/sockunion.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sockunion.c')
-rw-r--r--lib/sockunion.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/sockunion.c b/lib/sockunion.c
index 7721666e..1ae092bd 100644
--- a/lib/sockunion.c
+++ b/lib/sockunion.c
@@ -180,8 +180,7 @@ sockunion_str2su (const char *str)
int ret;
union sockunion *su;
- su = XMALLOC (MTYPE_SOCKUNION, sizeof (union sockunion));
- memset (su, 0, sizeof (union sockunion));
+ su = XCALLOC (MTYPE_SOCKUNION, sizeof (union sockunion));
ret = inet_pton (AF_INET, str, &su->sin.sin_addr);
if (ret > 0) /* Valid IPv4 address format. */
@@ -254,6 +253,7 @@ sockunion_accept (int sock, union sockunion *su)
client_sock = accept (sock, (struct sockaddr *) su, &len);
/* Convert IPv4 compatible IPv6 address to IPv4 address. */
+#if 0
#ifdef HAVE_IPV6
if (su->sa.sa_family == AF_INET6)
{
@@ -268,7 +268,7 @@ sockunion_accept (int sock, union sockunion *su)
}
}
#endif /* HAVE_IPV6 */
-
+#endif
return client_sock;
}
@@ -592,6 +592,7 @@ sockunion_getsockname (int fd)
su = XCALLOC (MTYPE_SOCKUNION, sizeof (union sockunion));
memcpy (su, &name, sizeof (struct sockaddr_in6));
+#if 0
if (IN6_IS_ADDR_V4MAPPED (&su->sin6.sin6_addr))
{
struct sockaddr_in sin;
@@ -601,6 +602,7 @@ sockunion_getsockname (int fd)
sin.sin_port = su->sin6.sin6_port;
memcpy (su, &sin, sizeof (struct sockaddr_in));
}
+#endif
return su;
}
#endif /* HAVE_IPV6 */
@@ -645,7 +647,7 @@ sockunion_getpeername (int fd)
{
su = XCALLOC (MTYPE_SOCKUNION, sizeof (union sockunion));
memcpy (su, &name, sizeof (struct sockaddr_in6));
-
+#if 0
if (IN6_IS_ADDR_V4MAPPED (&su->sin6.sin6_addr))
{
struct sockaddr_in sin;
@@ -655,6 +657,7 @@ sockunion_getpeername (int fd)
sin.sin_port = su->sin6.sin6_port;
memcpy (su, &sin, sizeof (struct sockaddr_in));
}
+#endif
return su;
}
#endif /* HAVE_IPV6 */