diff mbox

[net-2.6] can: omit received RTR frames for single ID filter lists

Message ID 49381618.8030109@hartkopp.net
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Oliver Hartkopp Dec. 4, 2008, 5:40 p.m. UTC
can: omit received RTR frames for single ID filter lists

Since commit d253eee20195b25e298bf162a6e72f14bf4803e5 the single CAN
identifier filter lists handle only non-RTR CAN frames.

So we need to omit the check of these filter lists when receiving RTR CAN frames.

Signed-Off-by: Oliver Hartkopp <oliver@hartkopp.net>
---

Hello Dave & Greg,

while writing a CAN filter test suite on a business trip i discovered a 
missing check that became necessary together with the referenced commit

'can: Fix CAN_(EFF|RTR)_FLAG handling in can_filter'

Sorry for the effort of this extra patch.

It should go into 2.6.28 before the bug fix window closes.

Additionally the patch applies down to 2.6.26. Greg please consider this patch 
together with the referenced one for stable .26 and .27 also.

Thanks & best regards,
Oliver

Comments

David Miller Dec. 4, 2008, 11:01 p.m. UTC | #1
From: Oliver Hartkopp <oliver@hartkopp.net>
Date: Thu, 04 Dec 2008 18:40:40 +0100

> can: omit received RTR frames for single ID filter lists
> 
> Since commit d253eee20195b25e298bf162a6e72f14bf4803e5 the single CAN
> identifier filter lists handle only non-RTR CAN frames.
> 
> So we need to omit the check of these filter lists when receiving RTR CAN frames.
> 
> Signed-Off-by: Oliver Hartkopp <oliver@hartkopp.net>

Applied to net-2.6, thanks.

Please stop capitalizing the "Off"  in Signed-off-by, I keep
correcting that for you :-)

Thanks again.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/can/af_can.c b/net/can/af_can.c
index d8173e5..3dadb33 100644
--- a/net/can/af_can.c
+++ b/net/can/af_can.c
@@ -622,7 +622,10 @@  static int can_rcv_filter(struct dev_rcv_lists *d, struct sk_buff *skb)
 		}
 	}
 
-	/* check CAN_ID specific entries */
+	/* check filterlists for single non-RTR can_ids */
+	if (can_id & CAN_RTR_FLAG)
+		return matches;
+
 	if (can_id & CAN_EFF_FLAG) {
 		hlist_for_each_entry_rcu(r, n, &d->rx[RX_EFF], list) {
 			if (r->can_id == can_id) {