Skip to content

Commit e5c9741

Browse files
committed
Revert "net: udp: fix handling of CHECKSUM_COMPLETE packets"
This reverts commit e7bbc87.
1 parent 590c51d commit e5c9741

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
@@ -2124,24 +2124,8 @@ static inline int udp4_csum_init(struct sk_buff *skb, struct udphdr *uh,
21242124
/* Note, we are only interested in != 0 or == 0, thus the
21252125
* force to int.
21262126
*/
2127-
err = (__force int)skb_checksum_init_zero_check(skb, proto, uh->check,
2128-
inet_compute_pseudo);
2129-
if (err)
2130-
return err;
2131-
2132-
if (skb->ip_summed == CHECKSUM_COMPLETE && !skb->csum_valid) {
2133-
/* If SW calculated the value, we know it's bad */
2134-
if (skb->csum_complete_sw)
2135-
return 1;
2136-
2137-
/* HW says the value is bad. Let's validate that.
2138-
* skb->csum is no longer the full packet checksum,
2139-
* so don't treat it as such.
2140-
*/
2141-
skb_checksum_complete_unset(skb);
2142-
}
2143-
2144-
return 0;
2127+
return (__force int)skb_checksum_init_zero_check(skb, proto, uh->check,
2128+
inet_compute_pseudo);
21452129
}
21462130

21472131
/* 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)