1CURLOPT_FTP_SKIP_PASV_IP(3)curl_easy_setopt optionsCURLOPT_FTP_SKIP_PASV_IP(3)
2
3
4
6 CURLOPT_FTP_SKIP_PASV_IP - ignore the IP address in the PASV response
7
9 #include <curl/curl.h>
10
11 CURLcode curl_easy_setopt(CURL *handle, CURLOPT_FTP_SKIP_PASV_IP, long
12 skip);
13
15 Pass a long. If skip is set to 1, it instructs libcurl to not use the
16 IP address the server suggests in its 227-response to libcurl's PASV
17 command when libcurl connects the data connection. Instead libcurl will
18 re-use the same IP address it already uses for the control connection.
19 But it will use the port number from the 227-response.
20
21 This option thus allows libcurl to work around broken server installa‐
22 tions that due to NATs, firewalls or incompetence report the wrong IP
23 address back. Setting the option also reduces the risk for various
24 sorts of client abuse by malicious servers.
25
26 This option has no effect if PORT, EPRT or EPSV is used instead of
27 PASV.
28
30 1 since 7.74.0, was 0 before then.
31
33 FTP
34
36 CURL *curl = curl_easy_init();
37 if(curl) {
38 curl_easy_setopt(curl, CURLOPT_URL, "ftp://example.com/file.txt");
39
40 /* please ignore the IP in the PASV response */
41 curl_easy_setopt(curl, CURLOPT_FTP_SKIP_PASV_IP, 1L);
42 ret = curl_easy_perform(curl);
43
44 curl_easy_cleanup(curl);
45 }
46
48 Added in 7.14.2
49
51 Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION
52 if not.
53
55 CURLOPT_FTPPORT(3), CURLOPT_FTP_USE_EPRT(3),
56
57
58
59libcurl 7.79.1 November 24, 2020 CURLOPT_FTP_SKIP_PASV_IP(3)