netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [AF_PACKET]: Allow multicast traffic to be caught by ORIGDEV when bonded
@ 2007-11-06 15:25 PJ Waskiewicz
  2007-11-07 10:21 ` David Miller
  2007-11-11  6:03 ` David Miller
  0 siblings, 2 replies; 6+ messages in thread
From: PJ Waskiewicz @ 2007-11-06 15:25 UTC (permalink / raw)
  To: davem; +Cc: netdev

The socket option for packet sockets to return the original ifindex instead
of the bonded ifindex will not match multicast traffic.  Since this socket
option is the most useful for layer 2 traffic and multicast traffic, make
the option multicast-aware.

Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
---

 net/packet/af_packet.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index 4cb2dfb..23eef6f 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -515,7 +515,7 @@ static int packet_rcv(struct sk_buff *skb, struct net_device *dev, struct packet
 	sll->sll_hatype = dev->type;
 	sll->sll_protocol = skb->protocol;
 	sll->sll_pkttype = skb->pkt_type;
-	if (unlikely(po->origdev) && skb->pkt_type == PACKET_HOST)
+	if (unlikely(po->origdev))
 		sll->sll_ifindex = orig_dev->ifindex;
 	else
 		sll->sll_ifindex = dev->ifindex;
@@ -661,7 +661,7 @@ static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev, struct packe
 	sll->sll_hatype = dev->type;
 	sll->sll_protocol = skb->protocol;
 	sll->sll_pkttype = skb->pkt_type;
-	if (unlikely(po->origdev) && skb->pkt_type == PACKET_HOST)
+	if (unlikely(po->origdev))
 		sll->sll_ifindex = orig_dev->ifindex;
 	else
 		sll->sll_ifindex = dev->ifindex;

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

* Re: [PATCH] [AF_PACKET]: Allow multicast traffic to be caught by ORIGDEV when bonded
  2007-11-06 15:25 [PATCH] [AF_PACKET]: Allow multicast traffic to be caught by ORIGDEV when bonded PJ Waskiewicz
@ 2007-11-07 10:21 ` David Miller
  2007-11-07 11:00   ` Waskiewicz Jr, Peter P
  2007-11-11  6:03 ` David Miller
  1 sibling, 1 reply; 6+ messages in thread
From: David Miller @ 2007-11-07 10:21 UTC (permalink / raw)
  To: peter.p.waskiewicz.jr; +Cc: netdev

From: PJ Waskiewicz <peter.p.waskiewicz.jr@intel.com>
Date: Tue, 06 Nov 2007 07:25:47 -0800

> The socket option for packet sockets to return the original ifindex instead
> of the bonded ifindex will not match multicast traffic.  Since this socket
> option is the most useful for layer 2 traffic and multicast traffic, make
> the option multicast-aware.
> 
> Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>

I agree with you in principle, but I'd like to hear some feedback
from other folks.  In particular I'd like a discussion about
what this might break, if anything.

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

* RE: [PATCH] [AF_PACKET]: Allow multicast traffic to be caught by ORIGDEV when bonded
  2007-11-07 10:21 ` David Miller
@ 2007-11-07 11:00   ` Waskiewicz Jr, Peter P
  2007-11-07 11:52     ` David Miller
  0 siblings, 1 reply; 6+ messages in thread
From: Waskiewicz Jr, Peter P @ 2007-11-07 11:00 UTC (permalink / raw)
  To: David Miller; +Cc: netdev

> > The socket option for packet sockets to return the original ifindex 
> > instead of the bonded ifindex will not match multicast 
> traffic.  Since 
> > this socket option is the most useful for layer 2 traffic and 
> > multicast traffic, make the option multicast-aware.
> > 
> > Signed-off-by: Peter P Waskiewicz Jr 
> <peter.p.waskiewicz.jr@intel.com>
> 
> I agree with you in principle, but I'd like to hear some 
> feedback from other folks.  In particular I'd like a 
> discussion about what this might break, if anything.

That's reasonable.  In any event, the only thing this could affect is if
the option is set on the socket, which shouldn't be very often at all.

I'm more than open to feedback on this change.

Thanks Dave,

-PJ Waskiewicz

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

* Re: [PATCH] [AF_PACKET]: Allow multicast traffic to be caught by ORIGDEV when bonded
  2007-11-07 11:00   ` Waskiewicz Jr, Peter P
@ 2007-11-07 11:52     ` David Miller
  2007-11-07 17:40       ` Waskiewicz Jr, Peter P
  0 siblings, 1 reply; 6+ messages in thread
From: David Miller @ 2007-11-07 11:52 UTC (permalink / raw)
  To: peter.p.waskiewicz.jr; +Cc: netdev

From: "Waskiewicz Jr, Peter P" <peter.p.waskiewicz.jr@intel.com>
Date: Wed, 7 Nov 2007 03:00:42 -0800

> In any event, the only thing this could affect is if the option is
> set on the socket, which shouldn't be very often at all.

Any idea how many programs set this option and which
ones?  You obviously noticed, so perhaps you know at
least one or was this discovered purely by code
inspection?

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

* RE: [PATCH] [AF_PACKET]: Allow multicast traffic to be caught by ORIGDEV when bonded
  2007-11-07 11:52     ` David Miller
@ 2007-11-07 17:40       ` Waskiewicz Jr, Peter P
  0 siblings, 0 replies; 6+ messages in thread
From: Waskiewicz Jr, Peter P @ 2007-11-07 17:40 UTC (permalink / raw)
  To: David Miller; +Cc: netdev

> -----Original Message-----
> From: David Miller [mailto:davem@davemloft.net] 
> Sent: Wednesday, November 07, 2007 3:52 AM
> To: Waskiewicz Jr, Peter P
> Cc: netdev@vger.kernel.org
> Subject: Re: [PATCH] [AF_PACKET]: Allow multicast traffic to 
> be caught by ORIGDEV when bonded
> 
> From: "Waskiewicz Jr, Peter P" <peter.p.waskiewicz.jr@intel.com>
> Date: Wed, 7 Nov 2007 03:00:42 -0800
> 
> > In any event, the only thing this could affect is if the 
> option is set 
> > on the socket, which shouldn't be very often at all.
> 
> Any idea how many programs set this option and which ones?  
> You obviously noticed, so perhaps you know at least one or 
> was this discovered purely by code inspection?

We have an application that communicates with a switch and a NIC that
helps some additional configuration for the network (think of it as an
extended link negotiation).  It uses LLDP, which is layer 2 and is
multicast.  We noticed that when testing bonding, it didn't work.  I'm
not sure who else might be using this code right now, since it went into
the mainstream kernel in 2.6.22.

Thanks,
-PJ

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

* Re: [PATCH] [AF_PACKET]: Allow multicast traffic to be caught by ORIGDEV when bonded
  2007-11-06 15:25 [PATCH] [AF_PACKET]: Allow multicast traffic to be caught by ORIGDEV when bonded PJ Waskiewicz
  2007-11-07 10:21 ` David Miller
@ 2007-11-11  6:03 ` David Miller
  1 sibling, 0 replies; 6+ messages in thread
From: David Miller @ 2007-11-11  6:03 UTC (permalink / raw)
  To: peter.p.waskiewicz.jr; +Cc: netdev

From: PJ Waskiewicz <peter.p.waskiewicz.jr@intel.com>
Date: Tue, 06 Nov 2007 07:25:47 -0800

> The socket option for packet sockets to return the original ifindex instead
> of the bonded ifindex will not match multicast traffic.  Since this socket
> option is the most useful for layer 2 traffic and multicast traffic, make
> the option multicast-aware.
> 
> Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>

Applied, thanks Peter.

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

end of thread, other threads:[~2007-11-11  6:03 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-06 15:25 [PATCH] [AF_PACKET]: Allow multicast traffic to be caught by ORIGDEV when bonded PJ Waskiewicz
2007-11-07 10:21 ` David Miller
2007-11-07 11:00   ` Waskiewicz Jr, Peter P
2007-11-07 11:52     ` David Miller
2007-11-07 17:40       ` Waskiewicz Jr, Peter P
2007-11-11  6:03 ` David Miller

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).