From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 586F2C43465 for ; Mon, 21 Sep 2020 16:37:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 039452399C for ; Mon, 21 Sep 2020 16:37:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600706252; bh=OYWucVYP7dD+UA/1BSwGw/P5H+lgPztv1OB0A580bek=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=M6vXHsCbqSOGl9DexC4MAa5FAtA4MM5Tw94NsYyxfIUg+9iRf4S9I/Icn6SYk7Hqn 46/j+fdyJgi6S3NEIohVT00bfbEqi1jeGlJAU4ROHNMQN0Qkvsc1f2xqgjX6QgZAjL epjo9XcP6H9v6j5gaQ1Yq4x7tjKrcVooNJ2MLx14= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729069AbgIUQha (ORCPT ); Mon, 21 Sep 2020 12:37:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:37172 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728541AbgIUQhC (ORCPT ); Mon, 21 Sep 2020 12:37:02 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D08D8239A1; Mon, 21 Sep 2020 16:37:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600706222; bh=OYWucVYP7dD+UA/1BSwGw/P5H+lgPztv1OB0A580bek=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0Lc0aLaELpYRDZ66yiVZFffbBbEWEBun+qckw8SBfRuzCMqKn6IJRzdkYIisOZXlB N0ucSNEiH6aSuSs9eLDpKqLDivHjm7gxbI6IKqSJpCBUZzilKAtyBqzwD3EnQcRKuO r5thov497/rjoJquOSS58rsLErUrPQmUGNYbvSCw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Martin Schiller , Xie He , "David S. Miller" , Sasha Levin Subject: [PATCH 4.14 15/94] drivers/net/wan/lapbether: Set network_header before transmitting Date: Mon, 21 Sep 2020 18:27:02 +0200 Message-Id: <20200921162036.245510560@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921162035.541285330@linuxfoundation.org> References: <20200921162035.541285330@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Xie He [ Upstream commit 91244d108441013b7367b3b4dcc6869998676473 ] Set the skb's network_header before it is passed to the underlying Ethernet device for transmission. This patch fixes the following issue: When we use this driver with AF_PACKET sockets, there would be error messages of: protocol 0805 is buggy, dev (Ethernet interface name) printed in the system "dmesg" log. This is because skbs passed down to the Ethernet device for transmission don't have their network_header properly set, and the dev_queue_xmit_nit function in net/core/dev.c complains about this. Reason of setting the network_header to this place (at the end of the Ethernet header, and at the beginning of the Ethernet payload): Because when this driver receives an skb from the Ethernet device, the network_header is also set at this place. Cc: Martin Schiller Signed-off-by: Xie He Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/wan/lapbether.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/wan/lapbether.c b/drivers/net/wan/lapbether.c index 6b2553e893aca..15177a54b17d7 100644 --- a/drivers/net/wan/lapbether.c +++ b/drivers/net/wan/lapbether.c @@ -213,6 +213,8 @@ static void lapbeth_data_transmit(struct net_device *ndev, struct sk_buff *skb) skb->dev = dev = lapbeth->ethdev; + skb_reset_network_header(skb); + dev_hard_header(skb, dev, ETH_P_DEC, bcast_addr, NULL, 0); dev_queue_xmit(skb); -- 2.25.1