Re: [PATCH] [AF_PACKET]: Allow multicast traffic to be caught by ORIGDEV when bonded

2007-11-10 Thread David Miller
From: PJ Waskiewicz [EMAIL PROTECTED]
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 [EMAIL PROTECTED]

Applied, thanks Peter.
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] [AF_PACKET]: Allow multicast traffic to be caught by ORIGDEV when bonded

2007-11-07 Thread David Miller
From: PJ Waskiewicz [EMAIL PROTECTED]
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 [EMAIL PROTECTED]

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.
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH] [AF_PACKET]: Allow multicast traffic to be caught by ORIGDEV when bonded

2007-11-07 Thread Waskiewicz Jr, Peter P
  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 
 [EMAIL PROTECTED]
 
 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
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] [AF_PACKET]: Allow multicast traffic to be caught by ORIGDEV when bonded

2007-11-07 Thread David Miller
From: Waskiewicz Jr, Peter P [EMAIL PROTECTED]
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?
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH] [AF_PACKET]: Allow multicast traffic to be caught by ORIGDEV when bonded

2007-11-07 Thread Waskiewicz Jr, Peter P
 -Original Message-
 From: David Miller [mailto:[EMAIL PROTECTED] 
 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 [EMAIL PROTECTED]
 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
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] [AF_PACKET]: Allow multicast traffic to be caught by ORIGDEV when bonded

2007-11-06 Thread PJ Waskiewicz
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 [EMAIL PROTECTED]
---

 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;
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html