summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Satiro <raysatiro@yahoo.com>2017-11-23 02:47:26 -0500
committerJay Satiro <raysatiro@yahoo.com>2017-11-23 02:47:26 -0500
commit31f18d27224f65249e719d87f5a5109378b3e420 (patch)
treee31139adffb972c3d9889a264280c734607bb767
parented22d8654b4e010e6eccec395e9ea93ac8ef0844 (diff)
downloadcurl-31f18d27224f65249e719d87f5a5109378b3e420.tar.gz
connect: improve the bind error message
eg consider a non-existent interface eth8, curl --interface eth8 Before: curl: (45) Could not resolve host: eth8 After: curl: (45) Couldn't bind to 'eth8' Bug: https://github.com/curl/curl/issues/2104 Reported-by: Alfonso Martone
-rw-r--r--lib/connect.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/connect.c b/lib/connect.c
index 16104bc4f..45e18bc07 100644
--- a/lib/connect.c
+++ b/lib/connect.c
@@ -412,6 +412,10 @@ static CURLcode bindlocal(struct connectdata *conn,
}
if(done < 1) {
+ /* errorbuf is set false so failf will overwrite any message already in
+ the error buffer, so the user receives this error message instead of a
+ generic resolve error. */
+ data->state.errorbuf = FALSE;
failf(data, "Couldn't bind to '%s'", dev);
return CURLE_INTERFACE_FAILED;
}