From patchwork Mon Jan 22 19:24:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Schiffer X-Patchwork-Id: 17250 X-Patchwork-Delegate: sw@simonwunderlich.de Return-Path: X-Original-To: patchwork@open-mesh.org Delivered-To: patchwork@open-mesh.org Received: from open-mesh.org (localhost [IPv6:::1]) by open-mesh.org (Postfix) with ESMTP id 6575C80C46; Mon, 22 Jan 2018 20:31:44 +0100 (CET) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2001:19f0:6c01:100::1; helo=orthanc.universe-factory.net; envelope-from=mschiffer@universe-factory.net; receiver= X-Greylist: delayed 380 seconds by postgrey-1.36 at open-mesh.org; Mon, 22 Jan 2018 20:31:39 CET Received: from orthanc.universe-factory.net (orthanc.universe-factory.net [IPv6:2001:19f0:6c01:100::1]) by open-mesh.org (Postfix) with ESMTPS id 5C75B80203 for ; Mon, 22 Jan 2018 20:31:39 +0100 (CET) Received: from localhost.localdomain (unknown [IPv6:2001:19f0:6c01:100::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by orthanc.universe-factory.net (Postfix) with ESMTPSA id B53361F4E6 for ; Mon, 22 Jan 2018 20:25:16 +0100 (CET) From: Matthias Schiffer To: b.a.t.m.a.n@lists.open-mesh.org Date: Mon, 22 Jan 2018 20:24:50 +0100 Message-Id: <6d1b250c047fb4cd3aac72d9e921ed33428fdaf5.1516648598.git.mschiffer@universe-factory.net> X-Mailer: git-send-email 2.16.0 Subject: [B.A.T.M.A.N.] [PATCH maint] batman-adv: fix packet checksum in receive path X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking Errors-To: b.a.t.m.a.n-bounces@lists.open-mesh.org Sender: "B.A.T.M.A.N" skb_postpull_rcsum() is necessary after eth_type_trans() to adjust the skb checksum, otherwise log spam of the form "bat0: hw csum failure" will result when packets with CHECKSUM_COMPLETE are received (at least in some setups, e.g. when stacking batman-adv on top of VXLAN). Signed-off-by: Matthias Schiffer Tested-by: Maximilian Wilhelm --- I don't know what the exact circumstances are that trigger the log spam, but it seems this was broken forever (I could also reproduce the issue with our compat-14 legacy branch)... so please ask David to queue this up for stable :) net/batman-adv/soft-interface.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c index c95e2b26..edeffcb9 100644 --- a/net/batman-adv/soft-interface.c +++ b/net/batman-adv/soft-interface.c @@ -459,13 +459,7 @@ void batadv_interface_rx(struct net_device *soft_iface, /* skb->dev & skb->pkt_type are set here */ skb->protocol = eth_type_trans(skb, soft_iface); - - /* should not be necessary anymore as we use skb_pull_rcsum() - * TODO: please verify this and remove this TODO - * -- Dec 21st 2009, Simon Wunderlich - */ - - /* skb->ip_summed = CHECKSUM_UNNECESSARY; */ + skb_postpull_rcsum(skb, eth_hdr(skb), ETH_HLEN); batadv_inc_counter(bat_priv, BATADV_CNT_RX); batadv_add_counter(bat_priv, BATADV_CNT_RX_BYTES,