cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: CURLOPT_LOCALPORT option broken ?!

From: Senthil Raja Velu <Senthil.Raja_at_ss8.com>
Date: Tue, 24 Feb 2009 13:34:34 -0800

Hi Markus,
The latest patch works fine even without c-ares for ip and hostname. And
the bind failure for bge0 is more informative as given below;

testsvr% curl --verbose --interface bge0 --local-port 60027-60028
https://10.20.4.19/cgi-bin/TEST/TEST.py
* About to connect() to 10.20.4.19 port 443 (#0)
* Trying 10.20.4.19... getaddrinfo(3) failed for bge0:0
* Couldn't bind to 'bge0'
* couldn't connect to host
* Closing connection #0

Thanks for all the support.
Senthil.

-----Original Message-----
From: curl-library-bounces_at_cool.haxx.se
[mailto:curl-library-bounces_at_cool.haxx.se] On Behalf Of
koettermarkus_at_gmx.de
Sent: Tuesday, February 24, 2009 4:41 AM
To: libcurl development
Subject: Re: CURLOPT_LOCALPORT option broken ?!

Hi,

Senthil Raja Velu wrote:
> Dan, Markus,
> Ok, it works now!. Great !! thanks for your support.
> Here are the test results with the latest patch and with c-ares 1.6.0;

I've been able to verify it works on Solaris 8 SunOS 5.8
Generic_117350-44 sun4u sparc SUNW,Ultra-60 Solaris without c-ares.

> testsvr% curl --verbose --interface bge0 --local-port 60027-60028

Curl on Solaris does not support --interface with a real interface, such
as bge0.

> https://10.20.4.19/cgi-bin/TEST/TEST.py
> * About to connect() to 10.20.4.19 port 443 (#0)
> * Trying 10.20.4.19... Could not resolve host: 10.20.4.19 (Could not
> contact DNS servers)
> * Couldn't bind to ''
> * couldn't connect to host
> * Closing connection #0
> curl: (7) Could not resolve host: 10.20.4.19 (Could not contact DNS
> servers)
>
>
> I guess the absence of DNS server in our local network is the one
> causing the problem with the patches!

Why did it work with unpatched curl in the same network on the same
machine? I don't know.
I have no idea how solaris resolver behaves if there is no dns server
(reachable).

> testsvr% curl --verbose --interface testsvr --local-port 60027-60028
> https://10.20.4.19/cgi-bin/TEST/TEST.py
> * About to connect() to 10.20.4.19 port 443 (#0)
> * Trying 10.20.4.19... Local IP/Domain 'testsvr' family 2 resolved
to
> '10.0.110.131' family 2
> * Local port: 60027
> * connected

Hopefully the last version of the patch is attached.
Removes socket_domain, as it is not used, fixes > * Couldn't bind to ''
if the dev could not be recognized as interface/domain/ip, and does not
try to connect a different/non equal af.

Please retry.

This time the patch is created different:

diff -Naur curl-7.19.4-20090219.orig/lib/connect.c
curl-7.19.4-20090219/lib/connect.c >
/tmp/curl_interface_and_port_patch-hopefully_the_last.diff

MfG
Markus
Received on 2009-02-24