mirror of
https://github.com/moparisthebest/curl
synced 2024-12-24 09:08:49 -05:00
bindlocal: detect and avoid IP version mismatches in bind()
Reported-by: Alex Grebenschikov Fixes #3993 Closes #4002
This commit is contained in:
parent
094b5f3540
commit
1667d5599d
@ -368,6 +368,11 @@ static CURLcode bindlocal(struct connectdata *conn,
|
|||||||
infof(data, "Name '%s' family %i resolved to '%s' family %i\n",
|
infof(data, "Name '%s' family %i resolved to '%s' family %i\n",
|
||||||
dev, af, myhost, h->addr->ai_family);
|
dev, af, myhost, h->addr->ai_family);
|
||||||
Curl_resolv_unlock(data, h);
|
Curl_resolv_unlock(data, h);
|
||||||
|
if(af != h->addr->ai_family) {
|
||||||
|
/* bad IP version combo, signal the caller to try another address
|
||||||
|
family if available */
|
||||||
|
return CURLE_UNSUPPORTED_PROTOCOL;
|
||||||
|
}
|
||||||
done = 1;
|
done = 1;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
Loading…
Reference in New Issue
Block a user