1--- 2c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al. 3SPDX-License-Identifier: curl 4Title: CURLOPT_FTP_SKIP_PASV_IP 5Section: 3 6Source: libcurl 7Protocol: 8 - FTP 9See-also: 10 - CURLOPT_FTPPORT (3) 11 - CURLOPT_FTP_USE_EPRT (3) 12--- 13 14# NAME 15 16CURLOPT_FTP_SKIP_PASV_IP - ignore the IP address in the PASV response 17 18# SYNOPSIS 19 20~~~c 21#include <curl/curl.h> 22 23CURLcode curl_easy_setopt(CURL *handle, CURLOPT_FTP_SKIP_PASV_IP, long skip); 24~~~ 25 26# DESCRIPTION 27 28Pass a long. If *skip* is set to 1, it instructs libcurl to not use the IP 29address the server suggests in its 227-response to libcurl's PASV command when 30libcurl connects the data connection. Instead libcurl reuses the same IP 31address it already uses for the control connection. It still uses the port 32number from the 227-response. 33 34This option allows libcurl to work around broken server installations or funny 35network setups that due to NATs, firewalls or incompetence report the wrong IP 36address. Setting this option also reduces the risk for various sorts of client 37abuse by malicious servers. 38 39This option has no effect if PORT, EPRT or EPSV is used instead of PASV. 40 41# DEFAULT 42 431 since 7.74.0, was 0 before then. 44 45# EXAMPLE 46 47~~~c 48int main(void) 49{ 50 CURL *curl = curl_easy_init(); 51 if(curl) { 52 CURLcode res; 53 curl_easy_setopt(curl, CURLOPT_URL, "ftp://example.com/file.txt"); 54 55 /* please ignore the IP in the PASV response */ 56 curl_easy_setopt(curl, CURLOPT_FTP_SKIP_PASV_IP, 1L); 57 res = curl_easy_perform(curl); 58 59 curl_easy_cleanup(curl); 60 } 61} 62~~~ 63 64# AVAILABILITY 65 66Added in 7.14.2 67 68# RETURN VALUE 69 70Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not. 71