fixed resolving numerical addresses in host_create_from_dns()
authorMartin Willi <martin@strongswan.org>
Wed, 11 Jun 2008 07:31:24 +0000 (07:31 -0000)
committerMartin Willi <martin@strongswan.org>
Wed, 11 Jun 2008 07:31:24 +0000 (07:31 -0000)
src/libstrongswan/utils/host.c

index b60d532..bc31f22 100644 (file)
@@ -480,7 +480,7 @@ host_t *host_create_from_dns(char *string, int af, u_int16_t port)
        }
        this = host_create_empty();
        this->address.sa_family = host.h_addrtype;
        }
        this = host_create_empty();
        this->address.sa_family = host.h_addrtype;
-       switch (af)
+       switch (this->address.sa_family)
        {
                case AF_INET:
                        memcpy(&this->address4.sin_addr.s_addr,
        {
                case AF_INET:
                        memcpy(&this->address4.sin_addr.s_addr,