diff options
author | Martin Willi <martin@revosec.ch> | 2012-11-12 15:49:48 +0100 |
---|---|---|
committer | Martin Willi <martin@revosec.ch> | 2012-11-29 10:22:52 +0100 |
commit | 98d0fd25a875cde3fd50b6a8392a4b37203e92bf (patch) | |
tree | e711da868fb7527f3b102997cf61289afa8d6a07 /src/libstrongswan/networking/host_resolver.c | |
parent | 47f35b46a14ee73edf9e42bc5bb113b85150292a (diff) | |
download | strongswan-98d0fd25a875cde3fd50b6a8392a4b37203e92bf.tar.bz2 strongswan-98d0fd25a875cde3fd50b6a8392a4b37203e92bf.tar.xz |
Remove numeric conversion from resolver, it is done directly in host_t
Diffstat (limited to 'src/libstrongswan/networking/host_resolver.c')
-rw-r--r-- | src/libstrongswan/networking/host_resolver.c | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/src/libstrongswan/networking/host_resolver.c b/src/libstrongswan/networking/host_resolver.c index 73ca3326b..71aa0b15f 100644 --- a/src/libstrongswan/networking/host_resolver.c +++ b/src/libstrongswan/networking/host_resolver.c @@ -225,33 +225,6 @@ static void *resolve_hosts(private_host_resolver_t *this) return NULL; } -/** - * Try to convert IP addresses directly - */ -static host_t *try_numeric_lookup(char *name, int family) -{ - struct addrinfo hints, *result; - int error; - host_t *host; - - memset(&hints, 0, sizeof(hints)); - hints.ai_family = family; - hints.ai_socktype = SOCK_DGRAM; - hints.ai_flags = AI_NUMERICHOST; - - error = getaddrinfo(name, NULL, &hints, &result); - if (error != 0) - { /* not an IP address */ - return NULL; - } - else - { /* result is a linked list, but we use only the first address */ - host = host_create_from_sockaddr(result->ai_addr); - freeaddrinfo(result); - } - return host; -} - METHOD(host_resolver_t, resolve, host_t*, private_host_resolver_t *this, char *name, int family) { @@ -273,11 +246,6 @@ METHOD(host_resolver_t, resolve, host_t*, { /* do not try to convert v6 addresses for v4 family */ return NULL; } - result = try_numeric_lookup(name, family); - if (result) - { /* shortcut for numeric IP addresses */ - return result; - } this->mutex->lock(this->mutex); if (this->disabled) { |