]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
drivers/net/wan/lapbether: Set network_header before transmitting
authorXie He <xie.he.0141@gmail.com>
Wed, 26 Aug 2020 03:03:53 +0000 (20:03 -0700)
committerStefan Bader <stefan.bader@canonical.com>
Mon, 9 Nov 2020 13:46:41 +0000 (14:46 +0100)
commit8462017ced46ef6c523e03266fcbd2a5ed25c921
tree937f2a56a9f597dd1aa3bf8ba90b39c847cc26f6
parenta534a28a9b5928f62cf76212679b4598d2db2c3c
drivers/net/wan/lapbether: Set network_header before transmitting

BugLink: https://bugs.launchpad.net/bugs/1896824
[ 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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: William Breathitt Gray <william.gray@canonical.com>
drivers/net/wan/lapbether.c