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

@ -257,6 +257,9 @@ static CURLcode bindlocal(struct Curl_easy *data,
#ifdef IP_BIND_ADDRESS_NO_PORT
int on = 1;
#endif
#ifndef ENABLE_IPV6
(void)scope;
#endif
/*************************************************************
* Select device to bind socket to
@ -314,8 +317,11 @@ static CURLcode bindlocal(struct Curl_easy *data,
}
#endif
switch(Curl_if2ip(af, scope, conn->scope_id, dev,
myhost, sizeof(myhost))) {
switch(Curl_if2ip(af,
#ifdef ENABLE_IPV6
scope, conn->scope_id,
#endif
dev, myhost, sizeof(myhost))) {
case IF2IP_NOT_FOUND:
if(is_interface) {
/* Do not fall back to treating it as a host name */