]>
Commit | Line | Data |
---|---|---|
9a58d64e GKH |
1 | From d5d3ebe3be5c5123f2d444e186717f45284151e2 Mon Sep 17 00:00:00 2001 |
2 | From: Shan Wei <shanwei@cn.fujitsu.com> | |
3 | Date: Fri, 12 Nov 2010 00:15:25 +0000 | |
4 | Subject: r8169: fix checksum broken | |
5 | ||
6 | From: Shan Wei <shanwei@cn.fujitsu.com> | |
7 | ||
8 | commit d5d3ebe3be5c5123f2d444e186717f45284151e2 upstream. | |
9 | ||
10 | If r8196 received packets with invalid sctp/igmp(not tcp, udp) checksum, r8196 set skb->ip_summed | |
11 | wit CHECKSUM_UNNECESSARY. This cause that upper protocol don't check checksum field. | |
12 | ||
13 | I am not family with r8196 driver. I try to guess the meaning of RxProtoIP and IPFail. | |
14 | RxProtoIP 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 | ||
17 | If it's right, I think we should not set ip_summed wit CHECKSUM_UNNECESSARY for my sctp packets | |
18 | with invalid checksum. | |
19 | ||
20 | If it's not right, please tell me. | |
21 | ||
22 | Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com> | |
23 | Acked-by: Francois Romieu <romieu@fr.zoreil.com> | |
24 | Signed-off-by: David S. Miller <davem@davemloft.net> | |
25 | Signed-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; |