Skip to content

Commit 5ca4ac2

Browse files
committed
Revert "net: udp: fix handling of CHECKSUM_COMPLETE packets"
This reverts commit a5d3335.
1 parent a5d3335 commit 5ca4ac2

File tree

3 files changed

+7
-36
lines changed

3 files changed

+7
-36
lines changed

net/core/datagram.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -807,6 +807,9 @@ int skb_copy_and_csum_datagram_msg(struct sk_buff *skb,
807807
iov_iter_revert(&msg->msg_iter, chunk);
808808
return -EINVAL;
809809
}
810+
811+
if (unlikely(skb->ip_summed == CHECKSUM_COMPLETE))
812+
netdev_rx_csum_fault(skb->dev);
810813
}
811814
return 0;
812815
fault:

net/ipv4/udp.c

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2120,24 +2120,8 @@ static inline int udp4_csum_init(struct sk_buff *skb, struct udphdr *uh,
21202120
/* Note, we are only interested in != 0 or == 0, thus the
21212121
* force to int.
21222122
*/
2123-
err = (__force int)skb_checksum_init_zero_check(skb, proto, uh->check,
2124-
inet_compute_pseudo);
2125-
if (err)
2126-
return err;
2127-
2128-
if (skb->ip_summed == CHECKSUM_COMPLETE && !skb->csum_valid) {
2129-
/* If SW calculated the value, we know it's bad */
2130-
if (skb->csum_complete_sw)
2131-
return 1;
2132-
2133-
/* HW says the value is bad. Let's validate that.
2134-
* skb->csum is no longer the full packet checksum,
2135-
* so don't treat it as such.
2136-
*/
2137-
skb_checksum_complete_unset(skb);
2138-
}
2139-
2140-
return 0;
2123+
return (__force int)skb_checksum_init_zero_check(skb, proto, uh->check,
2124+
inet_compute_pseudo);
21412125
}
21422126

21432127
/* wrapper for udp_queue_rcv_skb tacking care of csum conversion and

net/ipv6/ip6_checksum.c

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -88,24 +88,8 @@ int udp6_csum_init(struct sk_buff *skb, struct udphdr *uh, int proto)
8888
* Note, we are only interested in != 0 or == 0, thus the
8989
* force to int.
9090
*/
91-
err = (__force int)skb_checksum_init_zero_check(skb, proto, uh->check,
92-
ip6_compute_pseudo);
93-
if (err)
94-
return err;
95-
96-
if (skb->ip_summed == CHECKSUM_COMPLETE && !skb->csum_valid) {
97-
/* If SW calculated the value, we know it's bad */
98-
if (skb->csum_complete_sw)
99-
return 1;
100-
101-
/* HW says the value is bad. Let's validate that.
102-
* skb->csum is no longer the full packet checksum,
103-
* so don't treat is as such.
104-
*/
105-
skb_checksum_complete_unset(skb);
106-
}
107-
108-
return 0;
91+
return (__force int)skb_checksum_init_zero_check(skb, proto, uh->check,
92+
ip6_compute_pseudo);
10993
}
11094
EXPORT_SYMBOL(udp6_csum_init);
11195

0 commit comments

Comments
 (0)