The
setsockopt(sockfd, SOL_SOCKET, SO_BINDTODEVICE, ifname, sizeof (ifname))

Works by chance when ifname = eth0 or eth1 but fails with any name that
has more than 4 characters. In my case I used udev to rename interface
to eth_wan and eth-lan and it fails miserably.

The correct line is

setsockopt(sockfd, SOL_SOCKET, SO_BINDTODEVICE, ifname, strlen (ifname) + 1)

Otherwise it is a good idea to bind to listen only on the internal side.

-- eric





-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to