From patchwork Thu Dec 4 17:40:40 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oliver Hartkopp X-Patchwork-Id: 12288 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id 90B7DDDD01 for ; Fri, 5 Dec 2008 04:41:01 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759514AbYLDRku (ORCPT ); Thu, 4 Dec 2008 12:40:50 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1758140AbYLDRks (ORCPT ); Thu, 4 Dec 2008 12:40:48 -0500 Received: from mo-p00-ob.rzone.de ([81.169.146.161]:21884 "EHLO mo-p00-ob.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760025AbYLDRkr (ORCPT ); Thu, 4 Dec 2008 12:40:47 -0500 X-RZG-CLASS-ID: mo00 X-RZG-AUTH: :I2ANY0W6W/eA95XfH/xfO6gOxLxTty/udEMngcJ/VAKW226lDNJVyuUPITI/Mbsx Received: from [192.168.11.10] (p5B22EBC0.dip.t-dialin.net [91.34.235.192]) by post.strato.de (fruni mo37) (RZmta 17.20) with ESMTP id 405559kB4HDJj7 ; Thu, 4 Dec 2008 18:40:40 +0100 (MET) Message-ID: <49381618.8030109@hartkopp.net> Date: Thu, 04 Dec 2008 18:40:40 +0100 From: Oliver Hartkopp User-Agent: Mozilla-Thunderbird 2.0.0.17 (X11/20081018) MIME-Version: 1.0 To: David Miller , Greg KH CC: Kurt Van Dijck , Linux Netdev List , stable@kernel.org Subject: [PATCH net-2.6] can: omit received RTR frames for single ID filter lists References: <20081128153317.GA3726@e-circ.dyndns.org> In-Reply-To: <20081128153317.GA3726@e-circ.dyndns.org> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 --- 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 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) {