On 7/27/05, Charles Fischer <[EMAIL PROTECTED]> wrote: > I am patching a C program that opens a TCP/IP socket and listens. When > "accept" returns a connecting socket, the program calls a read routine that > does some checking. It would be nice if this read routine knew the > interface's name (ie, lo, eth0 or eth1). Does anybody know how to get the > interface's name from the socket ID (file ID)?
You might try getsockopt to see if the SO_BINDTODEVICE option is set. In general though I don't think that tcp sockets are normally bound to a particular device/interface. -- TriLUG mailing list : http://www.trilug.org/mailman/listinfo/trilug TriLUG Organizational FAQ : http://trilug.org/faq/ TriLUG Member Services FAQ : http://members.trilug.org/services_faq/ TriLUG PGP Keyring : http://trilug.org/~chrish/trilug.asc
