summaryrefslogtreecommitdiff
path: root/src/tcp.c
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2010-11-28 22:55:24 +0000
committerChristian Pointner <equinox@spreadspace.org>2010-11-28 22:55:24 +0000
commit174a9f39da1f09c6ffd9c6f0b3a6a42da5ec4163 (patch)
tree74bb2be118291b2df2ad7d18d33a6816626a32e6 /src/tcp.c
parentfirst minial version working (diff)
source address to connect from can now be specified
git-svn-id: https://svn.spreadspace.org/tcpproxy/trunk@13 e61f0598-a718-4e21-a8f0-0aadfa62ad6b
Diffstat (limited to 'src/tcp.c')
-rw-r--r--src/tcp.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/tcp.c b/src/tcp.c
index 0211526..cbc9134 100644
--- a/src/tcp.c
+++ b/src/tcp.c
@@ -60,6 +60,8 @@ char* tcp_endpoint_to_string(tcp_endpoint_t e)
addrstr_len = INET6_ADDRSTRLEN + 1;
addrport_sep = '.';
break;
+ case AF_UNSPEC:
+ return NULL;
default:
asprintf(&ret, "unknown address type");
return ret;
@@ -90,11 +92,11 @@ struct addrinfo* tcp_resolve_endpoint(const char* addr, const char* port, resolv
int errcode = getaddrinfo(addr, port, &hints, &res);
if (errcode != 0) {
- log_printf(ERROR, "Error resolving local address (%s:%s): %s", (addr) ? addr : "*", port, gai_strerror(errcode));
+ log_printf(ERROR, "Error resolving local address (%s:%s): %s", (addr) ? addr : "*", (port) ? port : "0", gai_strerror(errcode));
return NULL;
}
if(!res) {
- log_printf(ERROR, "getaddrinfo returned no address for %s:%s", addr, port);
+ log_printf(ERROR, "getaddrinfo returned no address for %s:%s", (addr) ? addr : "*", (port) ? port : "0");
return NULL;
}