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 01:30:40 -0800

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;

testsvr% curl --verbose --interface 10.0.110.131 --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 '10.0.110.131' family 2
resolved to '10.0.110.131' family 2
* Local port: 60027
* connected

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... 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!

 
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

Thanks,
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 12:19 AM
To: libcurl development
Subject: Re: CURLOPT_LOCALPORT option broken ?!

Daniel Stenberg wrote:
> On Tue, 24 Feb 2009, koettermarkus_at_gmx.de wrote:
>
>> attached is a new version of the patch, I removed the SO_BINDDEVICE
>> code , as it is not possible to bind an outgoing connection to an
>> interface. SO_BINDTODEVICE is meant to serve for bind()&listen()
only.
>
> Even if that might be the case, it has been proven to work (at least
to
> the exteny that it does not cause any failure) so it really shouldn't
be
> the reason for why this fails.
>

Correct, removing that piece of code is totally unrelated to the
solaris10 problem.

For the actual problem, I have no idea why resolving dev fails as the
whole code use to resolve dev to myhost did not change.

I hope Senthil will try the last patch with improved debug messages, so
we get some more information what is going wrong.

MfG
Markus
Received on 2009-02-24