Netdev List
 help / color / mirror / Atom feed
* How to indenfy the real physical network interface?
@ 2011-11-07 13:59 santosh
  2011-11-08  5:06 ` Peter P Waskiewicz Jr
  0 siblings, 1 reply; 2+ messages in thread
From: santosh @ 2011-11-07 13:59 UTC (permalink / raw)
  To: netdev

Hi,

I am posting this question to "netdev" mailing list because I could
not find "linux-net" mailing list as suggested at
http://kernelnewbies.org/ML .

I have a wireless device running on Linux 2.6.15. (Can't upgrade to
latest at this time).

It has 3 interfaces.
 ath0 - Wireless interface.
 eth0 - Ethernet interface.
 br0 - Bridge interface joining ath0 and eth0.

I have a user space socket program that listens to the broadcast
messages and responds.
My socket is opened as sock = socket(PF_INET, SOCK_DGRAM, 0).

I need this socket program to listen for the packet coming from
Ethernet interface only.
Or, this socket program should be able to figure out the actual
interface the packet come from.

I tried below methods but both doesn't help me because kernel is
giving bridge as interface and not giving the real interface to socket
program.

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

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 being controlled by
a Bridge?


Thanks,
Santosh

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-11-08  5:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-07 13:59 How to indenfy the real physical network interface? santosh
2011-11-08  5:06 ` Peter P Waskiewicz Jr

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox