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 4707AC433E2 for ; Tue, 15 Sep 2020 14:35:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0B0B720770 for ; Tue, 15 Sep 2020 14:35:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600180528; bh=OYWucVYP7dD+UA/1BSwGw/P5H+lgPztv1OB0A580bek=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=LM3AerdVY0sDjuTUZExfo+TLNnF4kV54vIw3hvg5yMKAKP1b+IxIaRRICYpaRupy6 j/ioXJ1kGz2FrwofKsfdLcXgAVTZsQvGtpnZ7pwP+jnvQiumZMP8ija7hd+ZhnV0Wu s5uvtvHx6LmEx72HVFff+ksgmjgtHvhb2EFHwTag= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727147AbgIOOfY (ORCPT ); Tue, 15 Sep 2020 10:35:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:48028 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726245AbgIOOfD (ORCPT ); Tue, 15 Sep 2020 10:35:03 -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 47F58221E8; Tue, 15 Sep 2020 14:15:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600179348; bh=OYWucVYP7dD+UA/1BSwGw/P5H+lgPztv1OB0A580bek=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eGWELl1Mk0wRi1r4uq71REMWT5zbSMSheZcSG76W5Knb0Jm338Tr/QWqrAlcUjBXY 6L7UKGQGKHdi8eQ04SIXfAHrWCSLxE68uZJ4qB5Bkjx13lwt8JN+oc0EhXdGdYmGIb 3hDzqeiNLKo+WzmGOXZn+yNo2WSVuRRd1X0lT+I4= 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.19 24/78] drivers/net/wan/lapbether: Set network_header before transmitting Date: Tue, 15 Sep 2020 16:12:49 +0200 Message-Id: <20200915140634.763971119@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200915140633.552502750@linuxfoundation.org> References: <20200915140633.552502750@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 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