1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-22 08:08:50 -05:00

Tor Arntsen pointed out a missing #ifdef for IPv6, and I changed another one

to use the "standard" ENABLE_IPV6 one. Also, if port number cannot be figured
out to connect to after a name resolve (due to it not being IPv4 or IPv6),
that particular address will now simply be skipped.
This commit is contained in:
Daniel Stenberg 2009-06-30 21:30:39 +00:00
parent 18f238dd53
commit 175fc5096d

View File

@ -1142,7 +1142,7 @@ static CURLcode ftp_state_use_port(struct connectdata *conn,
below */ below */
Curl_printable_address(ai, myhost, sizeof(myhost)); Curl_printable_address(ai, myhost, sizeof(myhost));
#ifdef PF_INET6 #ifdef ENABLE_IPV6
if(!conn->bits.ftp_use_eprt && conn->bits.ipv6) if(!conn->bits.ftp_use_eprt && conn->bits.ipv6)
/* EPRT is disabled but we are connected to a IPv6 host, so we ignore the /* EPRT is disabled but we are connected to a IPv6 host, so we ignore the
request and enable EPRT again! */ request and enable EPRT again! */
@ -1163,11 +1163,13 @@ static CURLcode ftp_state_use_port(struct connectdata *conn,
case AF_INET: case AF_INET:
port = ntohs(sa4->sin_port); port = ntohs(sa4->sin_port);
break; break;
#ifdef ENABLE_IPV6
case AF_INET6: case AF_INET6:
port = ntohs(sa6->sin6_port); port = ntohs(sa6->sin6_port);
break; break;
#endif
default: default:
break; continue; /* might as well skip this */
} }
if(EPRT == fcmd) { if(EPRT == fcmd) {