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 if PORT, EPRT or EPSV is used instead of PASV. 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