linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Xie He <xie.he.0141@gmail.com>, Martin Schiller <ms@dev.tdt.de>,
	"David S . Miller" <davem@davemloft.net>,
	Sasha Levin <sashal@kernel.org>,
	netdev@vger.kernel.org
Subject: [PATCH AUTOSEL 4.14 07/17] drivers/net/wan/lapbether: Set network_header before transmitting
Date: Mon,  7 Sep 2020 12:34:50 -0400	[thread overview]
Message-ID: <20200907163500.1281543-7-sashal@kernel.org> (raw)
In-Reply-To: <20200907163500.1281543-1-sashal@kernel.org>

From: Xie He <xie.he.0141@gmail.com>

[ 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 <ms@dev.tdt.de>
Signed-off-by: Xie He <xie.he.0141@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 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


  parent reply	other threads:[~2020-09-07 16:48 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-07 16:34 [PATCH AUTOSEL 4.14 01/17] ARC: HSDK: wireup perf irq Sasha Levin
2020-09-07 16:34 ` [PATCH AUTOSEL 4.14 02/17] dmaengine: acpi: Put the CSRT table after using it Sasha Levin
2020-09-07 16:34 ` [PATCH AUTOSEL 4.14 03/17] drivers/net/wan/lapbether: Added needed_tailroom Sasha Levin
2020-09-07 16:34 ` [PATCH AUTOSEL 4.14 04/17] NFC: st95hf: Fix memleak in st95hf_in_send_cmd Sasha Levin
2020-09-07 16:34 ` [PATCH AUTOSEL 4.14 05/17] firestream: Fix memleak in fs_open Sasha Levin
2020-09-07 16:34 ` [PATCH AUTOSEL 4.14 06/17] ALSA: hda: Fix 2 channel swapping for Tegra Sasha Levin
2020-09-07 16:34 ` Sasha Levin [this message]
2020-09-07 16:34 ` [PATCH AUTOSEL 4.14 08/17] cfg80211: regulatory: reject invalid hints Sasha Levin
2020-09-07 16:34 ` [PATCH AUTOSEL 4.14 09/17] net: usb: Fix uninit-was-stored issue in asix_read_phy_addr() Sasha Levin
2020-09-07 16:34 ` [PATCH AUTOSEL 4.14 10/17] xfs: initialize the shortform attr header padding entry Sasha Levin
2020-09-07 16:34 ` [PATCH AUTOSEL 4.14 11/17] irqchip/eznps: Fix build error for !ARC700 builds Sasha Levin
2020-09-07 16:34 ` [PATCH AUTOSEL 4.14 12/17] drivers/net/wan/hdlc_cisco: Add hard_header_len Sasha Levin
2020-09-07 16:34 ` [PATCH AUTOSEL 4.14 13/17] ARC: [plat-hsdk]: Switch ethernet phy-mode to rgmii-id Sasha Levin
2020-09-07 16:34 ` [PATCH AUTOSEL 4.14 14/17] cpufreq: intel_pstate: Refuse to turn off with HWP enabled Sasha Levin
2020-09-07 16:34 ` [PATCH AUTOSEL 4.14 15/17] net: usb: dm9601: Add USB ID of Keenetic Plus DSL Sasha Levin
2020-09-07 16:34 ` [PATCH AUTOSEL 4.14 16/17] ALSA: hda: fix a runtime pm issue in SOF when integrated GPU is disabled Sasha Levin
2020-09-07 16:35 ` [PATCH AUTOSEL 4.14 17/17] gcov: Disable gcov build with GCC 10 Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200907163500.1281543-7-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ms@dev.tdt.de \
    --cc=netdev@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=xie.he.0141@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).