summaryrefslogtreecommitdiff
path: root/src/tcp.c
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2010-11-28 23:24:16 +0000
committerChristian Pointner <equinox@spreadspace.org>2010-11-28 23:24:16 +0000
commit64ef9b77afabde7f0856d908489a5255107606ff (patch)
treea80035ed6f920e09f1c08762c831bd2479c83aba /src/tcp.c
parentreplaced inet_ntop with getnameinfo (diff)
added length field to tcp_endpoint_t
git-svn-id: https://svn.spreadspace.org/tcpproxy/trunk@15 e61f0598-a718-4e21-a8f0-0aadfa62ad6b
Diffstat (limited to 'src/tcp.c')
-rw-r--r--src/tcp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/tcp.c b/src/tcp.c
index c994eba..ea2af7d 100644
--- a/src/tcp.c
+++ b/src/tcp.c
@@ -44,7 +44,7 @@ char* tcp_endpoint_to_string(tcp_endpoint_t e)
char addrstr[INET6_ADDRSTRLEN + 1], portstr[6], *ret;
char addrport_sep = ':';
- switch(e.ss_family)
+ switch(e.addr_.ss_family)
{
case AF_INET: addrport_sep = ':'; break;
case AF_INET6: addrport_sep = '.'; break;
@@ -52,7 +52,7 @@ char* tcp_endpoint_to_string(tcp_endpoint_t e)
default: asprintf(&ret, "unknown address type"); return ret;
}
- int errcode = getnameinfo((struct sockaddr *)&e, sizeof(e), addrstr, sizeof(addrstr), portstr, sizeof(portstr), NI_NUMERICHOST | NI_NUMERICSERV);
+ int errcode = getnameinfo((struct sockaddr *)&(e.addr_), e.len_, addrstr, sizeof(addrstr), portstr, sizeof(portstr), NI_NUMERICHOST | NI_NUMERICSERV);
if (errcode != 0) return NULL;
asprintf(&ret, "%s%c%s", addrstr, addrport_sep ,portstr);
return ret;