summaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
authorXie He <xie.he.0141@gmail.com>2020-08-26 06:03:53 +0300
committerDavid S. Miller <davem@davemloft.net>2020-08-27 01:50:58 +0300
commit91244d108441013b7367b3b4dcc6869998676473 (patch)
treee4845e185f28c7f8000c002a499580d846c77df3 /drivers/net
parent1cec170d458b1d18f6f1654ca84c0804a701c5ef (diff)
downloadlinux-91244d108441013b7367b3b4dcc6869998676473.tar.xz
drivers/net/wan/lapbether: Set network_header before transmitting
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>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wan/lapbether.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/wan/lapbether.c b/drivers/net/wan/lapbether.c
index cc297ea9c6ec..e61616b0b91c 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);