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=-15.7 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=ham 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 48BD6C433E2 for ; Wed, 16 Sep 2020 00:07:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0C08820756 for ; Wed, 16 Sep 2020 00:07:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600214827; bh=ABVRVam/T0l6Mh0+MS2l8X+KafuL8BLB17lQR10F5HI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=UQEMWixhpVEja5r6SuQLH2Rmmo7bXcArJUOyEJNw8yJi76xQRf55HJuvxkCEjLSw3 qmd7I0NXBgTpmIuuru/U/deVB7C9ns9J8Y7BzlKQVRqon4N6wbheGsqtU3EwYaoOM2 4zqRJrp6MxUl+HmxkE8fJWCs+glq4XlRPkhE+XEI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727412AbgIPAHF (ORCPT ); Tue, 15 Sep 2020 20:07:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:41426 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726948AbgIOO2g (ORCPT ); Tue, 15 Sep 2020 10:28:36 -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 AFDED224B8; Tue, 15 Sep 2020 14:20:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600179608; bh=ABVRVam/T0l6Mh0+MS2l8X+KafuL8BLB17lQR10F5HI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=V95qzEHVnFPK4y6izVmE7Ie8Gh/+71S3ZSInCCS6JeumQC/sZyjCql5OfxRo6OKej WY82Z0SOqHX4QaqheoqULVuNq5rfeTFFGqZPrFv7O9gTLElhYtj5UPYvddIuK4FJ6L nZNhD4+U4rVZSiHQ+LgdhNoxeif6HJZDNVbn2I+0= 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 5.4 047/132] drivers/net/wan/lapbether: Set network_header before transmitting Date: Tue, 15 Sep 2020 16:12:29 +0200 Message-Id: <20200915140646.471598933@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200915140644.037604909@linuxfoundation.org> References: <20200915140644.037604909@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@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 373c9ce4010a3..2cff914aada55 100644 --- a/drivers/net/wan/lapbether.c +++ b/drivers/net/wan/lapbether.c @@ -210,6 +210,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