Hi,

My device is using Kamikaze.
My device has 3 interfaces.
ath0 - Radio interface.
eth0 - Ethernet interface.
br0 - Bridge interface joining ath0 and eth0.

I have a small socket program that listens to the broadcast messages
and responds.
I need this socket program to listen for the messages coming from
Ethernet interface only.
Or, this socket program should be able to figure out the actual
interface the message come from.

I tried below methods but both doesn't help me because it seems like
kernel is not providing real interface name to socket programs.

1.     //setsockopt(sock, SOL_SOCKET, SO_BINDTODEVICE, "br0", 3)
        setsockopt(sock, SOL_SOCKET, SO_BINDTODEVICE, "eth0", 6)

2.     setsockopt(sock, SOL_IP, IP_PKTINFO, (char *) &on, sizeof on)
        // Use recvmsg instead of recvfrom and read the interface index.
        // If interface is not Ethernet do not respond.

Can you please let me know if there is a way to identify the actual
interface in a UDP socket program when traffic is controlled by a
Bridge?


Thanks,
Santosh Yadawar
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to