SO_BINDTODEVICE use?

Matthew Kirkwood (weejock@ferret.lmh.ox.ac.uk)
Tue, 18 Nov 1997 22:47:41 +0000 (GMT)


Hi,

I know that this isn't exactly a kernel issue,
but how do I go about binding a socket to, for
example eth0?

i.e. at what stage in the:

socket()
bind()
listen()
accept()

should I do the ioctl(fd,SO_BINDTODEVICE,&ifr);?

Also, if I bind, say, an inetd socket to "eth0",
will it allow connections from "lo"?

I'm looking to patch inetd so that the third argument
can optionally become tcp:eth0, or udp:lo, etc....

Comments?

Cheers,
Matthew.