]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/2.6.36.2/r8169-fix-checksum-broken.patch
fixes for 4.19
[thirdparty/kernel/stable-queue.git] / releases / 2.6.36.2 / r8169-fix-checksum-broken.patch
CommitLineData
9a58d64e
GKH
1From d5d3ebe3be5c5123f2d444e186717f45284151e2 Mon Sep 17 00:00:00 2001
2From: Shan Wei <shanwei@cn.fujitsu.com>
3Date: Fri, 12 Nov 2010 00:15:25 +0000
4Subject: r8169: fix checksum broken
5
6From: Shan Wei <shanwei@cn.fujitsu.com>
7
8commit d5d3ebe3be5c5123f2d444e186717f45284151e2 upstream.
9
10If r8196 received packets with invalid sctp/igmp(not tcp, udp) checksum, r8196 set skb->ip_summed
11wit CHECKSUM_UNNECESSARY. This cause that upper protocol don't check checksum field.
12
13I am not family with r8196 driver. I try to guess the meaning of RxProtoIP and IPFail.
14RxProtoIP stands for received IPv4 packet that upper protocol is not tcp and udp.
15!(opts1 & IPFail) is true means that driver correctly to check checksum in IPv4 header.
16
17If it's right, I think we should not set ip_summed wit CHECKSUM_UNNECESSARY for my sctp packets
18with invalid checksum.
19
20If it's not right, please tell me.
21
22Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
23Acked-by: Francois Romieu <romieu@fr.zoreil.com>
24Signed-off-by: David S. Miller <davem@davemloft.net>
25Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
26
27---
28 drivers/net/r8169.c | 3 +--
29 1 file changed, 1 insertion(+), 2 deletions(-)
30
31--- a/drivers/net/r8169.c
32+++ b/drivers/net/r8169.c
33@@ -4460,8 +4460,7 @@ static inline void rtl8169_rx_csum(struc
34 u32 status = opts1 & RxProtoMask;
35
36 if (((status == RxProtoTCP) && !(opts1 & TCPFail)) ||
37- ((status == RxProtoUDP) && !(opts1 & UDPFail)) ||
38- ((status == RxProtoIP) && !(opts1 & IPFail)))
39+ ((status == RxProtoUDP) && !(opts1 & UDPFail)))
40 skb->ip_summed = CHECKSUM_UNNECESSARY;
41 else
42 skb->ip_summed = CHECKSUM_NONE;