1CURLOPT_FTP_SKIP_PASV_IP(3)curl_easy_setopt optionsCURLOPT_FTP_SKIP_PASV_IP(3)
2
3
4

NAME

6       CURLOPT_FTP_SKIP_PASV_IP - ignore the IP address in the PASV response
7

SYNOPSIS

9       #include <curl/curl.h>
10
11       CURLcode curl_easy_setopt(CURL *handle, CURLOPT_FTP_SKIP_PASV_IP, long skip);
12

DESCRIPTION

14       Pass  a  long. If skip is set to 1, it instructs libcurl to not use the
15       IP address the server suggests in its 227-response  to  libcurl's  PASV
16       command when libcurl connects the data connection. Instead libcurl will
17       re-use the same IP address it already uses for the control  connection.
18       But it will use the port number from the 227-response.
19
20       This  option thus allows libcurl to work around broken server installa‐
21       tions that due to NATs, firewalls or incompetence report the  wrong  IP
22       address  back.  Setting  the  option  also reduces the risk for various
23       sorts of client abuse by malicious servers.
24
25       This option has no effect if PORT, EPRT or  EPSV  is  used  instead  of
26       PASV.
27

DEFAULT

29       1 since 7.74.0, was 0 before then.
30

PROTOCOLS

32       FTP
33

EXAMPLE

35       CURL *curl = curl_easy_init();
36       if(curl) {
37         curl_easy_setopt(curl, CURLOPT_URL, "ftp://example.com/file.txt");
38
39         /* please ignore the IP in the PASV response */
40         curl_easy_setopt(curl, CURLOPT_FTP_SKIP_PASV_IP, 1L);
41         ret = curl_easy_perform(curl);
42
43         curl_easy_cleanup(curl);
44       }
45

AVAILABILITY

47       Added in 7.14.2
48

RETURN VALUE

50       Returns  CURLE_OK  if the option is supported, and CURLE_UNKNOWN_OPTION
51       if not.
52

SEE ALSO

54       CURLOPT_FTPPORT(3), CURLOPT_FTP_USE_EPRT(3),
55
56
57
58libcurl 7.82.0                 November 26, 2021   CURLOPT_FTP_SKIP_PASV_IP(3)
Impressum