aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstrongswan/utils/host.c
diff options
context:
space:
mode:
authorMartin Willi <martin@revosec.ch>2010-12-22 11:42:44 +0100
committerMartin Willi <martin@revosec.ch>2011-01-05 16:46:04 +0100
commit5eae41c6d8d3b15ceb65c0328d98aeb74b7701dd (patch)
treef152472dc6cd739c75b6dd20ae600bbba0ebdd90 /src/libstrongswan/utils/host.c
parent6aba6ff061875a8b834b70826219ccb8dfebb063 (diff)
downloadstrongswan-5eae41c6d8d3b15ceb65c0328d98aeb74b7701dd.tar.bz2
strongswan-5eae41c6d8d3b15ceb65c0328d98aeb74b7701dd.tar.xz
Fail silently when trying to convert IPv6 address to v4 family host
Diffstat (limited to 'src/libstrongswan/utils/host.c')
-rw-r--r--src/libstrongswan/utils/host.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libstrongswan/utils/host.c b/src/libstrongswan/utils/host.c
index 50e43d992..ffeebd05c 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;