diff options
author | Daniel Stenberg <daniel@haxx.se> | 2003-05-12 13:06:48 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2003-05-12 13:06:48 +0000 |
commit | 871358a6e552b991177446d4c96acc5dd892c213 (patch) | |
tree | c855457c7095823b1839baa51873ce35329ee3c1 | |
parent | 2e2e0fba608760de2eea7f998de0f7733c9ddb73 (diff) |
before checking for network interfaces using if2ip(), check that the given
name isn't an ip address
-rw-r--r-- | lib/connect.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/connect.c b/lib/connect.c index 1b7a55b5a..125d388d8 100644 --- a/lib/connect.c +++ b/lib/connect.c @@ -213,7 +213,11 @@ static CURLcode bindlocal(struct connectdata *conn, char myhost[256] = ""; in_addr_t in; - if(Curl_if2ip(data->set.device, myhost, sizeof(myhost))) { + /* First check if the given name is an IP address */ + in=inet_addr(data->set.device); + + if((in == INADDR_NONE) && + Curl_if2ip(data->set.device, myhost, sizeof(myhost))) { /* * We now have the numerical IPv4-style x.y.z.w in the 'myhost' buffer */ |