David Peters wrote:
> Yes. I am working on an app that creates a socket, sends some data, then
> closes it. The device I am using has eth0 and possibly eth1. If eth1
> exists, I want to use it instead of eth0.
If it's an IP socket you can use a setsockopt(SOL_SOCKET,
SO_BINDTODEVICE, ...) (see "man setsockopt" and "man 7 socket").
If it's a packet socket you look up the interface index with
a SIOCGIFINDEX and bind(2) to that.
Mike
--
Mike Jagdis Web:
http://www.eris-associates.co.uk
Eris Associates Limited Tel: +44 7780 608 368
Reading, England Fax: +44 118 926 6974