netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* AF_PACKET how to get the original netdev from a packet received from a bonded master
@ 2007-04-18 23:05 Laurent Chavey
  2007-04-18 23:25 ` David Miller
  0 siblings, 1 reply; 7+ messages in thread
From: Laurent Chavey @ 2007-04-18 23:05 UTC (permalink / raw)
  To: netdev

When using PF_PACKET socket with bonded interfaces, there is no
way to get the slave interface (physical interface) the packet was
actually received on.

It looks like  there isn't a way to pass the original device {see
packet_rcv() in ./net/packet/af_packet.c} to the socket reader.
When an interface is bounded, dev, by the time it reaches this function,
points to the the bonding interface not the Ethernet interface the packet
was receive on.  sockaddr_ll does not contain any fields that could be use to
pass the original device in.  As such there is no ways for an application
that is interested on the "physical interface" the packet was received on,
to get the information when running a bond (one that uses the same mac address
for all of its slave).


observation,
if one uses tcpdump on a bonded slave, only egress packets are taped.
if one uses tcpdump on a bonded master, ingress packets are taped, egress
packets are taped

from the above, it would make sense to have the same behavior on ingress/egress
for both slave and master. the later would require the taped packet be
"duplicated"
at packet_rcv() and passed up to the socket layer as two copies
   - one associated with the master dev
   - one associated with the slave dev.

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

end of thread, other threads:[~2007-04-23 19:03 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-18 23:05 AF_PACKET how to get the original netdev from a packet received from a bonded master Laurent Chavey
2007-04-18 23:25 ` David Miller
     [not found]   ` <41b516cb0704181652o6a05b570t511ee23373a0b3ac@mail.gmail.com>
     [not found]     ` <20070418.170749.07021824.davem@davemloft.net>
2007-04-19  0:17       ` Chris Leech
2007-04-19  1:06         ` David Miller
2007-04-19  2:02           ` Chris Leech
2007-04-19 20:55             ` Chris Friesen
2007-04-23 19:03     ` Laurent Chavey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).