Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp649087pxb; Thu, 21 Oct 2021 06:57:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyuU4M4ZvK3Cbjba5zjkhMd1ZsFdKcgo8V8qWLQAumXm3Gj58VDVAyaA211P2ALjEzC+Lk7 X-Received: by 2002:a50:ef10:: with SMTP id m16mr7822441eds.224.1634824621841; Thu, 21 Oct 2021 06:57:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634824621; cv=none; d=google.com; s=arc-20160816; b=WK9iSG+nRyxszhyz60VmYKKCj9ddk/HWbcKL/3bMhwc9leGCtrF8qqjW2UhxT6ebYs 33hjNSNxlFZgZZLqR94+5sLjJX89AJFf40M4ViCv9Vl+UxrXXZu4BJAgCSs4dqxFpDec Cam3vyA+zVP6csOxp3xol/MrS5MB2+sVqk51xhWVCOUJBqbWEyx2AWgNb47XT2UoXxvO PenBU/eHdPRfwJPwZVEj+zcpvaZGkDtkZZ1UO2fSRnKueQ2h4n8sVOSWFoY0DjI1iVmh DDNnzZ0372azDCZmjUQ0o55PkaYRleHkG0VX0IbOqxOKhrxM32WFV4oXwnsfIzODR5Ij a81A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=6uvyZY+GIOD/4yJqsK+RWFTVp9iY7Hng+X8l1Ok4KHw=; b=CR5N0VWSfYFcdgXUT66FxA7hw5MRmivOv2LMZEMYs2kzFUdthVIPlCZhkObTPolYae QyXaacoktJbELjnPaAwc6QWSGd+kImhRPo+vuJfgbVkRl2qrP676WmXLyokzqc/Kkdx5 OMlAnAjyU6NDElql0LoiZEN8GaHRnbScAY29gHZ1GluAjam9qIbHswNvXHOgP95dUeqE ASeM+0ebakWmiRvdDrx9/R3OcDRm0VaomminA6OvYNBgKFtTdzpDPshUVCHj+OVKU213 KSUBZlbsHLCcDL59Z+bUfyzCw+c8wb9Rn10Jn3rR9ZjjcISmBuizIOzOaRw/NHLvguBj M5pw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hq39si10408883ejc.42.2021.10.21.06.56.36; Thu, 21 Oct 2021 06:57:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231599AbhJUN4h (ORCPT + 99 others); Thu, 21 Oct 2021 09:56:37 -0400 Received: from szxga02-in.huawei.com ([45.249.212.188]:25308 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230283AbhJUN4c (ORCPT ); Thu, 21 Oct 2021 09:56:32 -0400 Received: from dggemv703-chm.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4HZpkT2yb6zbfXP; Thu, 21 Oct 2021 21:49:37 +0800 (CST) Received: from dggpeml500006.china.huawei.com (7.185.36.76) by dggemv703-chm.china.huawei.com (10.3.19.46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.15; Thu, 21 Oct 2021 21:54:11 +0800 Received: from compute.localdomain (10.175.112.70) by dggpeml500006.china.huawei.com (7.185.36.76) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.15; Thu, 21 Oct 2021 21:54:11 +0800 From: Zhang Changzhong To: Robin van der Gracht , Oleksij Rempel , , Oliver Hartkopp , Marc Kleine-Budde , "David S. Miller" , Jakub Kicinski CC: Zhang Changzhong , , , Subject: [PATCH net 1/3] can: j1939: j1939_tp_cmd_recv(): ignore abort message in the BAM transport Date: Thu, 21 Oct 2021 22:04:15 +0800 Message-ID: <1634825057-47915-2-git-send-email-zhangchangzhong@huawei.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1634825057-47915-1-git-send-email-zhangchangzhong@huawei.com> References: <1634825057-47915-1-git-send-email-zhangchangzhong@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.112.70] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpeml500006.china.huawei.com (7.185.36.76) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch prevents BAM transport from being closed by receiving abort message, as specified in SAE-J1939-82 2015 (A.3.3 Row 4). Fixes: 9d71dd0c7009 ("can: add support of SAE J1939 protocol") Signed-off-by: Zhang Changzhong --- net/can/j1939/transport.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/can/j1939/transport.c b/net/can/j1939/transport.c index bb5c4b8..2efa606 100644 --- a/net/can/j1939/transport.c +++ b/net/can/j1939/transport.c @@ -2081,6 +2081,9 @@ static void j1939_tp_cmd_recv(struct j1939_priv *priv, struct sk_buff *skb) break; case J1939_ETP_CMD_ABORT: /* && J1939_TP_CMD_ABORT */ + if (j1939_cb_is_broadcast(skcb)) + return; + if (j1939_tp_im_transmitter(skcb)) j1939_xtp_rx_abort(priv, skb, true); -- 2.9.5