diff options
author | Xie He <xie.he.0141@gmail.com> | 2020-08-25 20:03:53 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-09-17 13:45:24 +0200 |
commit | b562614b70dfbe6a32ce625d0280c5d313652581 (patch) | |
tree | c0f693d425fab2b6d1d176c88b831358f63d4735 /drivers/net/wan | |
parent | c2d03591ac5f666ebc6ba9887efaa94162262bcb (diff) | |
download | linux-stable-b562614b70dfbe6a32ce625d0280c5d313652581.tar.gz linux-stable-b562614b70dfbe6a32ce625d0280c5d313652581.tar.bz2 linux-stable-b562614b70dfbe6a32ce625d0280c5d313652581.zip |
drivers/net/wan/lapbether: Set network_header before transmitting
[ 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>
Diffstat (limited to 'drivers/net/wan')
-rw-r--r-- | drivers/net/wan/lapbether.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/wan/lapbether.c b/drivers/net/wan/lapbether.c index 6b2553e893ac..15177a54b17d 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); |