]> andersk Git - openssh.git/blobdiff - fake-getaddrinfo.c
- (djm) Clean up. Strip some unnecessary differences with OpenBSD's code,
[openssh.git] / fake-getaddrinfo.c
index b3af4aa2e1f0ec2d7e156df106a45bf61a192241..73c122ed11776cd01c3397ed4ad07b3c1aea43b6 100644 (file)
@@ -65,6 +65,7 @@ int getaddrinfo(const char *hostname, const char *servname,
 {
        struct addrinfo *cur, *prev = NULL;
        struct hostent *hp;
+       struct in_addr in;
        int i, port;
 
        if (servname)
@@ -86,8 +87,8 @@ int getaddrinfo(const char *hostname, const char *servname,
                        return EAI_MEMORY;
        }
        
-       if (inet_addr(hostname) != -1) {
-               if (NULL != (*res = malloc_ai(port, inet_addr(hostname))))
+       if (inet_aton(hostname, &in)) {
+               if (NULL != (*res = malloc_ai(port, in.s_addr)))
                        return 0;
                else
                        return EAI_MEMORY;
This page took 0.071419 seconds and 4 git commands to generate.