mirror of
https://github.com/torvalds/linux
synced 2024-11-05 18:23:50 +00:00
r8152: fix wrong checksum status for received IPv4 packets
The device could only check the checksum of TCP and UDP packets. Therefore, for the IPv4 packets excluding TCP and UDP, the check of checksum is necessary, even though the IP checksum is correct. Take ICMP for example, The IP checksum may be correct, but the ICMP checksum may be wrong. Signed-off-by: Hayes Wang <hayeswang@realtek.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
1d8ef0c076
commit
ea6499e160
1 changed files with 3 additions and 5 deletions
|
@ -1848,11 +1848,9 @@ static u8 r8152_rx_csum(struct r8152 *tp, struct rx_desc *rx_desc)
|
|||
if (opts2 & RD_IPV4_CS) {
|
||||
if (opts3 & IPF)
|
||||
checksum = CHECKSUM_NONE;
|
||||
else if ((opts2 & RD_UDP_CS) && (opts3 & UDPF))
|
||||
checksum = CHECKSUM_NONE;
|
||||
else if ((opts2 & RD_TCP_CS) && (opts3 & TCPF))
|
||||
checksum = CHECKSUM_NONE;
|
||||
else
|
||||
else if ((opts2 & RD_UDP_CS) && !(opts3 & UDPF))
|
||||
checksum = CHECKSUM_UNNECESSARY;
|
||||
else if ((opts2 & RD_TCP_CS) && !(opts3 & TCPF))
|
||||
checksum = CHECKSUM_UNNECESSARY;
|
||||
} else if (opts2 & RD_IPV6_CS) {
|
||||
if ((opts2 & RD_UDP_CS) && !(opts3 & UDPF))
|
||||
|
|
Loading…
Reference in a new issue