misc: remove unused data when IPv6 is not supported

Closes #8430
This commit is contained in:
MAntoniak 2022-02-07 20:47:09 +01:00 committed by Daniel Stenberg
parent ae5e57c304
commit 06eb208126
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
7 changed files with 52 additions and 18 deletions

View file

@ -1029,8 +1029,11 @@ static CURLcode ftp_state_use_port(struct Curl_easy *data,
if(*addr != '\0') {
/* attempt to get the address of the given interface name */
switch(Curl_if2ip(conn->ip_addr->ai_family,
#ifdef ENABLE_IPV6
Curl_ipv6_scope(conn->ip_addr->ai_addr),
conn->scope_id, addr, hbuf, sizeof(hbuf))) {
conn->scope_id,
#endif
addr, hbuf, sizeof(hbuf))) {
case IF2IP_NOT_FOUND:
/* not an interface, use the given string as host name instead */
host = addr;