host_create_from_dns() tries a numeric conversion before asking resolver

This commit is contained in:
Martin Willi
2012-11-29 10:22:51 +01:00
parent f5fe52bf9a
commit 47f35b46a1
+5 -1
View 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);