netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Oliver Hartkopp <oliver@hartkopp.net>
To: David Miller <davem@davemloft.net>, Greg KH <greg@kroah.com>
Cc: Kurt Van Dijck <kurt.van.dijck@eia.be>,
	Linux Netdev List <netdev@vger.kernel.org>,
	stable@kernel.org
Subject: [PATCH net-2.6] can: omit received RTR frames for single ID filter lists
Date: Thu, 04 Dec 2008 18:40:40 +0100	[thread overview]
Message-ID: <49381618.8030109@hartkopp.net> (raw)
In-Reply-To: <20081128153317.GA3726@e-circ.dyndns.org>

[-- Attachment #1: Type: text/plain, Size: 823 bytes --]

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



[-- Attachment #2: can_rx_filter.patch --]
[-- Type: text/x-patch, Size: 490 bytes --]

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

  parent reply	other threads:[~2008-12-04 17:40 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20081128153317.GA3726@e-circ.dyndns.org>
2008-12-01 16:15 ` [PATCH] can: Fix CAN_(EFF|RTR)_FLAG handling in can_filter Oliver Hartkopp
2008-12-01 17:52   ` Sam Ravnborg
2008-12-01 18:42     ` Oliver Hartkopp
2008-12-01 18:52       ` Sam Ravnborg
2008-12-02 10:01       ` Kurt Van Dijck
2008-12-03 23:53   ` David Miller
2008-12-04 16:52     ` Oliver Hartkopp
2008-12-04 17:40 ` Oliver Hartkopp [this message]
2008-12-04 23:01   ` [PATCH net-2.6] can: omit received RTR frames for single ID filter lists David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=49381618.8030109@hartkopp.net \
    --to=oliver@hartkopp.net \
    --cc=davem@davemloft.net \
    --cc=greg@kroah.com \
    --cc=kurt.van.dijck@eia.be \
    --cc=netdev@vger.kernel.org \
    --cc=stable@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).