cURL
Haxx ad
libcurl

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-tracker Archives

[curl:bugs] #1189 after failure in bindlocal(), we should try the next address, not return a fatal error

From: Kim Vandry <vandry_at_users.sf.net>
Date: Wed, 03 Apr 2013 20:32:19 +0000

Hi Daniel,

Yes, it still works, and it still fixes the use case in my application. However I discovered two additional problems (which my application does not encounter) during testing, both related to IPv6 address scope (e.g. link-local addresses). So I made some additional changes:

https://github.com/bagder/curl/pull/63

- Filter the choice of address in Curl_if2ip to only consider addresses with the same scope ID as the connection address (mismatched scope for local and remote address does not result in a working connection).
- bindlocal was ignoring the scope ID of addresses returned by Curl_if2ip . Now it uses them.

---
** [bugs:#1189] after failure in bindlocal(), we should try the next address, not return a fatal error**
**Status:** open-confirmed
**Created:** Fri Feb 08, 2013 06:56 PM UTC by Kim Vandry
**Last Updated:** Tue Apr 02, 2013 02:35 PM UTC
**Owner:** Daniel Stenberg
I am using curl_easy_setopt(CURLOPT_INTERFACE, "if!something") to force transfers to use a particular interface but the transfer fails with CURLE_INTERFACE_FAILED, "Failed binding local connection end" if the interface I specify has no IPv6 address. The cause is as follows:
1. The remote hostname resolves successfully and has an IPv6 address and an IPv4 address.
2. cURL attempts to connect to the IPv6 address first.
3. bindlocal (in lib/connect.c) fails because Curl_if2ip cannot find an IPv6 address on the interface.
4. This is a fatal error in singleipconnect()
What I was hoping for is that it would try the next IP address in the list.
If I patch singleipconnect() to treat a CURLE_INTERFACE_FAILED error from bindlocal() as a non-fatal error, everything works: it tries the IPv4 address, and that succeeds.
I do not want to disable IPv6 completely (perhaps using CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4) because sometimes the interface I am binding to might have an IPv6 address.
Please consider applying the suggested patch or something similar.
Thank you!
---
Sent from sourceforge.net because you indicated interest in <https://sourceforge.net/p/curl/bugs/1189/>
To unsubscribe from further messages, please visit <https://sourceforge.net/auth/subscriptions/>
Received on 2013-04-03

These mail archives are generated by hypermail.

donate! Page updated January 05, 2012.
web site info

File upload with ASP.NET