cURL / Mailing Lists / curl-users / Single Mail

curl-users

Curl has problems with virtual NICs e.g eth0:1

From: Simon Loewenthal/NL/Tele2 <simon.loewenthal_at_tele2.com>
Date: Thu, 26 Nov 2009 14:27:27 +0100

Chere tous,

    I have a question about curl usage with the --interface option and
virtual NICs.

This works,
r3k-app56:/usr/local/bin # curl -v -s -S -k --interface eth0 --ftp-pasv
--ftp-skip-pasv-ip --ftp-ssl --ftp-ssl-ccc -u 'ACC50506:9f2o82sAZe'
ftp://1.2.3.4:21
* About to connect() to 1.2.3.4 port 21 (#0)
* Trying 1.2.3.4... Bind local address to 10.254.177.90
* Local port: 39694
^C

...But this does not,
r3k-app56:/usr/local/bin # curl -v -s -S -k --interface eth0:1
--ftp-pasv --ftp-skip-pasv-ip --ftp-ssl --ftp-ssl-ccc -u
'ACC50506:9f2o82sAZe' ftp://1.2.3.4:21
* About to connect() to 1.2.3.4 port 21 (#0)
* Trying 1.2.3.4... Bind local address to 10.254.177.92
* SO_BINDTODEVICE eth0:1 failed
* Local port: 45386
^C

Curl certainly can obtain the correct IP address from the virtual device
as shown in the second example:
* Trying 1.2.3.4... Bind local address to 10.254.177.92
but then is unhappy
* SO_BINDTODEVICE eth0:1 failed

I have tried putting the virtual eth0:1 inside:
'eth0:1'
"eth0:1"
eth0\:1
and these all fail with the same message.

Can Curl deal with virtual eathernet cards, or is there a hack for this?

Best regards, S.

PS. When the NIC is replaced with the IP on the interface then it does
not complain, but I would rather use the actual interface.
r3k-app56:/usr/local/bin # curl -v -s -S -k --interface 10.254.177.92
--ftp-pasv --ftp-skip-pasv-ip --ftp-ssl --ftp-ssl-ccc -u
'ACC50506:9f2o82sAZe' ftp://1.2.3.4:21
* About to connect() to 1.2.3.4 port 21 (#0)
* Trying 1.2.3.4... Bind local address to 10.254.177.92
* Local port: 33130

-- 
Simon Loewenthal/Tele2
GSM: +31 6 2000 5427
******** IMPORTANT NOTICE ********
Please repect the X-Reply to klunky.co.uk. PGP available 0xD86A5A17
This e-mail (including any attachments) may contain information that is confidential or otherwise protected from disclosure and it is intended only for the addressees. If you are not the intended recipient, please note that any copying, distribution or other use of information contained in this e-mail (and its attachments) is not allowed. If you have received this e-mail in error, kindly notify us immediately by telephone or e-mail and delete the message (including any attachments) from your system.
Please note that e-mail messages may contain computer viruses or other defects, may not be accurately replicated on other systems, or may be subject of unauthorized interception or other interference without the knowledge of sender or recipient. Tele2 only send and receive e-mails on the basis that Tele2 is not responsible for any such computer viruses, corruption or other interference or any consequences thereof.  It ought to be obvious that my views do not represent my employer's views.
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ:        http://curl.haxx.se/docs/faq.html
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2009-11-26