aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2003-05-13 12:11:31 +0000
committerDaniel Stenberg <daniel@haxx.se>2003-05-13 12:11:31 +0000
commita51258b6bbec9e075894f5aa2e180b6c40613ba8 (patch)
treed2d7bdad94b49d8d7a59b7f4bef67fdacd14cd79 /lib
parent8894bd07b6d0a04dccbbe473aa70c5eba0e5f7a6 (diff)
before using if2ip(), check if the address is an ip address and skip it if
it is.
Diffstat (limited to 'lib')
-rw-r--r--lib/ftp.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/ftp.c b/lib/ftp.c
index 5b79662c2..7b4d8abab 100644
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -1212,7 +1212,13 @@ CURLcode ftp_use_port(struct connectdata *conn)
bool sa_filled_in = FALSE;
if(data->set.ftpport) {
- if(Curl_if2ip(data->set.ftpport, myhost, sizeof(myhost))) {
+ in_addr_t in;
+
+ /* First check if the given name is an IP address */
+ in=inet_addr(data->set.ftpport);
+
+ if((in == CURL_INADDR_NONE) &&
+ Curl_if2ip(data->set.ftpport, myhost, sizeof(myhost))) {
h = Curl_resolv(data, myhost, 0);
}
else {