host_create_from_dns() tries a numeric conversion before asking resolver
authorMartin Willi <martin@revosec.ch>
Mon, 12 Nov 2012 14:48:48 +0000 (15:48 +0100)
committerMartin Willi <martin@revosec.ch>
Thu, 29 Nov 2012 09:22:51 +0000 (10:22 +0100)
src/libstrongswan/networking/host.c

index 160a6ec..3270f0c 100644 (file)
@@ -450,7 +450,11 @@ host_t *host_create_from_dns(char *string, int af, u_int16_t port)
 {
        host_t *this;
 
-       this = lib->hosts->resolve(lib->hosts, string, af);
+       this = host_create_from_string_and_family(string, af, port);
+       if (!this)
+       {
+               this = lib->hosts->resolve(lib->hosts, string, af);
+       }
        if (this)
        {
                this->set_port(this, port);