drivers/net/wan/lapbether: Set network_header before transmitting
Subsystems (3)
PATCH 1/1 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.
--- drivers/net/wan/lapbether.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/wan/lapbether.c +2 -0
@@ -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);
Signature · 1 line
2.25.1
From: Xie He <[email protected]>
Date: Tue, 25 Aug 2020 20:03:53 -0700
Quoted 14 lines
Set the skb's
network_headerbefore it is passed to the underlying Ethernet device for transmission.This patch fixes the following issue:
When we use this driver with
AF_PACKETsockets, 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_headerproperly set, and thedev_queue_xmit_nitfunction innet/core/dev.ccomplains about this.
Quoted 8 lines
Reason of setting the
network_headerto 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_headeris also set at this place.Cc Martin Schiller <[email protected]>Signed-off-by Xie He <[email protected]>
Applied, thank you.