1b51979d71ca144389ab1de3f2d7e7c26c1ea2eb
[openwrt/staging/mkresin.git] /
1 From 195e2d9febfbeef1d09701c387925e5c2f5cb038 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
3 Date: Thu, 11 Feb 2021 13:12:38 +0100
4 Subject: [PATCH] net: broadcom: bcm4908_enet: fix received skb length
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 Use ETH_FCS_LEN instead of magic value and drop incorrect + 2
10
11 Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
12 Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
13 Signed-off-by: David S. Miller <davem@davemloft.net>
14 ---
15 drivers/net/ethernet/broadcom/bcm4908_enet.c | 2 +-
16 1 file changed, 1 insertion(+), 1 deletion(-)
17
18 --- a/drivers/net/ethernet/broadcom/bcm4908_enet.c
19 +++ b/drivers/net/ethernet/broadcom/bcm4908_enet.c
20 @@ -567,7 +567,7 @@ static int bcm4908_enet_poll(struct napi
21
22 dma_unmap_single(dev, slot.dma_addr, slot.len, DMA_FROM_DEVICE);
23
24 - skb_put(slot.skb, len - 4 + 2);
25 + skb_put(slot.skb, len - ETH_FCS_LEN);
26 slot.skb->protocol = eth_type_trans(slot.skb, enet->netdev);
27 netif_receive_skb(slot.skb);
28