summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Thompson <andy@fud.org.nz>2011-06-29 23:48:19 +0200
committerMartin Sustrik <sustrik@250bpm.com>2011-06-29 23:48:19 +0200
commit4f4cc7328054272fa2c972244b2b7e8378ad5429 (patch)
tree4dd51c2dc8201f414dcf98f6897d95698579bdc7 /src
parent543ad30e7d15a8864df26d6d32e57246ede35ae3 (diff)
Use strrchr to ensure we split off the last colon for the service port
IPv6 addresses have colons and will produce invalid data for the getaddrinfo lookup. Signed-off-by: Andrew Thompson <andy@fud.org.nz>
Diffstat (limited to 'src')
-rw-r--r--src/ip.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ip.cpp b/src/ip.cpp
index c24d92f..a4f9562 100644
--- a/src/ip.cpp
+++ b/src/ip.cpp
@@ -272,7 +272,7 @@ int zmq::resolve_ip_hostname (sockaddr_storage *addr_, socklen_t *addr_len_,
const char *hostname_)
{
// Find the ':' that separates hostname name from service.
- const char *delimiter = strchr (hostname_, ':');
+ const char *delimiter = strrchr (hostname_, ':');
if (!delimiter) {
errno = EINVAL;
return -1;