From 9cc572baf5cba4472fd54820fb18384f91ac4e8f Mon Sep 17 00:00:00 2001 From: Gal Tsubery Date: Wed, 2 Jun 2021 12:38:31 -0500 Subject: [PATCH] Support ipv6 addresses Semicolons are part of ipv6 notation so we need to look for the last occurrence of ':' using `strrchar` instead of the first one --- src/tcpkali_dns.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tcpkali_dns.c b/src/tcpkali_dns.c index 17793d8..3f79290 100644 --- a/src/tcpkali_dns.c +++ b/src/tcpkali_dns.c @@ -75,7 +75,7 @@ void resolve_address(char *address, struct addrinfo **res) { char *hostport = strdup(address); char *host = hostport; - char *service_string = strchr(hostport, ':'); + char *service_string = strrchr(hostport, ':'); if(service_string) { *service_string++ = '\0'; } else {