summaryrefslogtreecommitdiff
path: root/lib/hostip4.c
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2008-11-06 17:19:56 +0000
committerYang Tse <yangsita@gmail.com>2008-11-06 17:19:56 +0000
commita0ef686c542bee30be0b20cd4d3243bec6b4f059 (patch)
treef2eeaa5b9920664defdd021eea0b98e9d6119f41 /lib/hostip4.c
parent2903a5c0500210f0a3934352fe29217b2b8e1dbf (diff)
downloadcurl-a0ef686c542bee30be0b20cd4d3243bec6b4f059.tar.gz
Merged existing IPv4 and IPv6 Curl_ip2addr functions into a single one
which now also takes a protocol address family argument.
Diffstat (limited to 'lib/hostip4.c')
-rw-r--r--lib/hostip4.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/hostip4.c b/lib/hostip4.c
index 576c35828..f7100417e 100644
--- a/lib/hostip4.c
+++ b/lib/hostip4.c
@@ -118,20 +118,18 @@ Curl_addrinfo *Curl_getaddrinfo(struct connectdata *conn,
#endif
Curl_addrinfo *ai = NULL;
struct hostent *h = NULL;
- in_addr_t in;
+ struct in_addr in;
struct hostent *buf = NULL;
#ifdef CURL_DISABLE_VERBOSE_STRINGS
(void)conn;
#endif
- (void)port; /* unused in IPv4 code */
-
*waitp = 0; /* don't wait, we act synchronously */
- if(1 == Curl_inet_pton(AF_INET, hostname, &in))
+ if(Curl_inet_pton(AF_INET, hostname, &in) > 0)
/* This is a dotted IP address 123.123.123.123-style */
- return Curl_ip2addr(in, hostname, port);
+ return Curl_ip2addr(AF_INET, &in, hostname, port);
#if defined(HAVE_GETHOSTBYNAME_R)
/*