CURLOPT_FTP_SKIP_PASV_IP(3)
π CURLOPT_FTP_SKIP_PASV_IP(3) π
okay so real quick β this is a page from the Library Functions Manual, and the star of the show is CURLOPT_FTP_SKIP_PASV_IP, iykyk β¨
π NAME π
CURLOPT_FTP_SKIP_PASV_IP β bestie, it literally means: ignore the IP address in the PASV response π
πΈ SYNOPSIS πΈ
#include <curl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_FTP_SKIP_PASV_IP, long skip);
π¦ DESCRIPTION π¦
So you pass a long, right? And if skip is set to 1, you're telling libcurl: do not use the IP address that the server suggests in its 227-response to libcurl's PASV command when libcurl connects the data connection. Nope. Not today. π
Instead, libcurl reuses the exact same IP address it's already using for the control connection. Periodt. But β and this is important β it still uses the port number from the 227-response. So the port stays, only the IP gets the skip treatment β¨
Why does this matter? Because this option lets libcurl work around broken server installations or, like, funny network setups that go around reporting the wrong IP address thanks to NATs, firewalls, or honestly just plain incompetence π Setting this option also reduces the risk for various sorts of client abuse by malicious servers, which is lowkey a slay for your security π«Ά
heads up: this option has no effect ifPORT,EPRTorEPSVis used instead ofPASV. Like, zero. none. don't come for me π
β DEFAULT β
1 since 7.74.0, was 0 before then. the glow-up is real π
π PROTOCOLS π
This functionality affects ftp only π
π EXAMPLE π
int main(void)
{
CURL *curl = curl_easy_init();
if(curl) {
CURLcode result;
curl_easy_setopt(curl, CURLOPT_URL, "ftp://example.com/file.txt");
/* please ignore the IP in the PASV response */
curl_easy_setopt(curl, CURLOPT_FTP_SKIP_PASV_IP, 1L);
result = curl_easy_perform(curl);
curl_easy_cleanup(curl);
}
}
look at that comment β please ignore the IP in the PASV response β she's so polite about it π₯Ή
π§ AVAILABILITY π§
Added in curl 7.15.0 β vintage, but make it iconic π
π RETURN VALUE π
curl_easy_setopt(3) returns a CURLcode indicating success or error.
CURLE_OK (0) means everything was OK π and non-zero means an error occurred β go check libcurl-errors(3) for the deets π₯
π SEE ALSO π
and that's the whole vibe check, bestie π this page came from libcurl, dated 2026-10-12 β CURLOPT_FTP_SKIP_PASV_IP(3), out βοΈπ
π¦ where this page comes from
- fedora 44: libcurl-devel 8.18.0-14.fc44 Β· curl
- fedora 44: libcurl-devel 8.18.0-14.fc44 Β· curl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms