From: Martin Willi Date: Wed, 22 Dec 2010 10:42:44 +0000 (+0100) Subject: Fail silently when trying to convert IPv6 address to v4 family host X-Git-Tag: 4.5.1~167 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5eae41c6d8d3b15ceb65c0328d98aeb74b7701dd;p=thirdparty%2Fstrongswan.git Fail silently when trying to convert IPv6 address to v4 family host --- diff --git a/src/libstrongswan/utils/host.c b/src/libstrongswan/utils/host.c index 50e43d9926..ffeebd05c6 100644 --- a/src/libstrongswan/utils/host.c +++ b/src/libstrongswan/utils/host.c @@ -476,6 +476,10 @@ host_t *host_create_from_dns(char *string, int af, u_int16_t port) { return host_create_any_port(af ? af : AF_INET6, port); } + if (af == AF_INET && strchr(string, ':')) + { /* do not try to convert v6 addresses for v4 family */ + return NULL; + } memset(&hints, 0, sizeof(hints)); hints.ai_family = af;