Hi Stefanus,
you wrote:
> used to match any interface and only legal for binding. Then how do you
> set sockaddr_ll to use eth0? I tried to set ifindex = 0 anyway and bind
> it with the socket descriptor, but sendto() also failed. Can anybody
> enlighten me?
Use the if_nametoindex() function declared in <net/if.h> to obtain the
index for a given interface name. The index is not hardcoded by the
interface name but depends on the initialization order.
Michael
--
Linux@TekXpress
http://www-users.rwth-aachen.de/Mich...kxp/tekxp.html