diff options
author | Daniel Stenberg <daniel@haxx.se> | 2005-03-16 22:01:39 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2005-03-16 22:01:39 +0000 |
commit | 61133545f6790f3d6ae4fcfdb4bc7a3156a17cdd (patch) | |
tree | cc692c119c515f6ff6a0cc9250e8ded8ae96b92f /lib/hostip4.c | |
parent | bf87d13f5b94aed8876d2c950faeadf7e6636128 (diff) | |
download | curl-61133545f6790f3d6ae4fcfdb4bc7a3156a17cdd.tar.gz |
- Tru64 and some IRIX boxes seem to not like test 237 as it is. Their
inet_addr() functions seems to use &255 on all numericals in a ipv4 dotted
address which makes a different failure... Now I've modified the ipv4
resolve code to use inet_pton() instead in an attempt to make these systems
better detect this as a bad IP address rather than creating a toally bogus
address that is then passed on and used.
Diffstat (limited to 'lib/hostip4.c')
-rw-r--r-- | lib/hostip4.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/hostip4.c b/lib/hostip4.c index ebbb9e375..97c42360a 100644 --- a/lib/hostip4.c +++ b/lib/hostip4.c @@ -79,6 +79,7 @@ #include "share.h" #include "strerror.h" #include "url.h" +#include "inet_pton.h" #define _MPRINTF_REPLACE /* use our functions only */ #include <curl/mprintf.h> @@ -202,11 +203,9 @@ Curl_addrinfo *Curl_getaddrinfo(struct connectdata *conn, *waitp = 0; /* don't wait, we act synchronously */ - in=inet_addr(hostname); - if (in != CURL_INADDR_NONE) { + if(1 == inet_pton(AF_INET, hostname, &in)) /* This is a dotted IP address 123.123.123.123-style */ return Curl_ip2addr(in, hostname, port); - } #if defined(HAVE_GETHOSTBYNAME_R) /* |