Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp1466061pxb; Wed, 12 Jan 2022 15:43:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJwttUm++WuEkkvZV/qGvJ8fye8YJQVwyr8jfvI3NumPsHQr2KxmfLFj7hgVS7ZMHzFe9LEa X-Received: by 2002:a05:6402:2752:: with SMTP id z18mr1818183edd.108.1642031027034; Wed, 12 Jan 2022 15:43:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642031027; cv=none; d=google.com; s=arc-20160816; b=EQX5jDHalrbzkSbGevD8r8Ao6W1E3YaALsxs2Vjq39NzXVwjUieQ4wCak8EfoCUMFn DvIJeOUwAzPYD6GWwx3NTIkhliTa3nbrZC0AyAKVL5aW8xM5a+A5ha0/M/thHpP1verQ ieHqSA1I2y6H+RKKH7G96H/b1mq+PkOqdeBb2OsQ5TmF+JwW8O2Ixax6kGhQFXLSl/zP 0mn2CJtC4FRH3ZaofqWwCuItSTXRoVgTJSVpkZ9vRNfBnSqBOCLfNFWjgU1vTGJffZiP 2+PJILlD9uWLfUGobligoemDionI/BzA4aB4i9/lw7Uht1G4rGZ9SqF6wmIMvJWEJUvW UXRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=HKw2muU3mPEaIenQAbnL6SBC7r6ikcjq8c5m2FG2xm4=; b=gGFZLlgEMqP1XcBMbz31bXN8S8vAhXzy7wVKfhPTAPLfe8pcVBLstjDHtvL6ZDumbT Rvf/4rvkRRjTQo1UtAFHA7Tu8ANhjFmLRgK20Qa4agTUshYRjYFPaa0OYp2JJWquu+sr 5AJDmvQ2pmCfEVghbz46jXAkrdbxYfCYAdUJtjdxPmp3Cvrhs2iL8lqPjPFAxv6Eumg1 5rB1vGcZ0AsSChp6vDiPUdbIBVEw9O86877VpKJXOnXMeA1lfBsdwAC6yolqx47QtrDk Y0fJd2CTNJJV4AjxOYTIuEUvMQR4P5YU4H1TizpHIu/5vMI4Tf5jf6yorRfrCLeK2b9E yGQw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gz11si580291ejc.577.2022.01.12.15.43.30; Wed, 12 Jan 2022 15:43:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-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-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355668AbiALRde (ORCPT + 71 others); Wed, 12 Jan 2022 12:33:34 -0500 Received: from relay7-d.mail.gandi.net ([217.70.183.200]:41583 "EHLO relay7-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242291AbiALRdb (ORCPT ); Wed, 12 Jan 2022 12:33:31 -0500 Received: (Authenticated sender: miquel.raynal@bootlin.com) by relay7-d.mail.gandi.net (Postfix) with ESMTPSA id 8084E2000C; Wed, 12 Jan 2022 17:33:28 +0000 (UTC) From: Miquel Raynal To: Alexander Aring , Stefan Schmidt , linux-wpan@vger.kernel.org, "David S. Miller" , Jakub Kicinski , netdev@vger.kernel.org Cc: Michael Hennerich , Harry Morris , Varka Bhadram , Xue Liu , Alan Ott , David Girault , Romuald Despres , Frederic Blain , Nicolas Schodet , Thomas Petazzoni , linux-wireless@vger.kernel.org, Miquel Raynal Subject: [wpan-next v2 07/27] net: ieee802154: hwsim: Ensure frame checksum are valid Date: Wed, 12 Jan 2022 18:32:52 +0100 Message-Id: <20220112173312.764660-8-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220112173312.764660-1-miquel.raynal@bootlin.com> References: <20220112173312.764660-1-miquel.raynal@bootlin.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org There is no point in accepting frames with a wrong or missing checksum, at least not outside of a promiscuous setting. Set the right flag by default in the hwsim driver to ensure checksums are not ignored. Signed-off-by: Miquel Raynal --- drivers/net/ieee802154/mac802154_hwsim.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ieee802154/mac802154_hwsim.c b/drivers/net/ieee802154/mac802154_hwsim.c index a2827c0acabe..8f87f2b8129d 100644 --- a/drivers/net/ieee802154/mac802154_hwsim.c +++ b/drivers/net/ieee802154/mac802154_hwsim.c @@ -836,7 +836,7 @@ static int hwsim_add_one(struct genl_info *info, struct device *dev, phy->idx = idx; INIT_LIST_HEAD(&phy->edges); - hw->flags = IEEE802154_HW_PROMISCUOUS; + hw->flags = IEEE802154_HW_PROMISCUOUS | IEEE802154_HW_RX_DROP_BAD_CKSUM; hw->parent = dev; err = ieee802154_register_hw(hw); -- 2.27.0