Skip to content

Commit

Permalink
Revert "net: udp: fix handling of CHECKSUM_COMPLETE packets"
Browse files Browse the repository at this point in the history
This reverts commit a5d3335.
  • Loading branch information
popcornmix committed Oct 17, 2018
1 parent a5d3335 commit 5ca4ac2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 36 deletions.
3 changes: 3 additions & 0 deletions net/core/datagram.c
Original file line number Diff line number Diff line change
Expand Up @@ -807,6 +807,9 @@ int skb_copy_and_csum_datagram_msg(struct sk_buff *skb,
iov_iter_revert(&msg->msg_iter, chunk);
return -EINVAL;
}

if (unlikely(skb->ip_summed == CHECKSUM_COMPLETE))
netdev_rx_csum_fault(skb->dev);
}
return 0;
fault:
Expand Down
20 changes: 2 additions & 18 deletions net/ipv4/udp.c
Original file line number Diff line number Diff line change
Expand Up @@ -2120,24 +2120,8 @@ static inline int udp4_csum_init(struct sk_buff *skb, struct udphdr *uh,
/* Note, we are only interested in != 0 or == 0, thus the
* force to int.
*/
err = (__force int)skb_checksum_init_zero_check(skb, proto, uh->check,
inet_compute_pseudo);
if (err)
return err;

if (skb->ip_summed == CHECKSUM_COMPLETE && !skb->csum_valid) {
/* If SW calculated the value, we know it's bad */
if (skb->csum_complete_sw)
return 1;

/* HW says the value is bad. Let's validate that.
* skb->csum is no longer the full packet checksum,
* so don't treat it as such.
*/
skb_checksum_complete_unset(skb);
}

return 0;
return (__force int)skb_checksum_init_zero_check(skb, proto, uh->check,
inet_compute_pseudo);
}

/* wrapper for udp_queue_rcv_skb tacking care of csum conversion and
Expand Down
20 changes: 2 additions & 18 deletions net/ipv6/ip6_checksum.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,24 +88,8 @@ int udp6_csum_init(struct sk_buff *skb, struct udphdr *uh, int proto)
* Note, we are only interested in != 0 or == 0, thus the
* force to int.
*/
err = (__force int)skb_checksum_init_zero_check(skb, proto, uh->check,
ip6_compute_pseudo);
if (err)
return err;

if (skb->ip_summed == CHECKSUM_COMPLETE && !skb->csum_valid) {
/* If SW calculated the value, we know it's bad */
if (skb->csum_complete_sw)
return 1;

/* HW says the value is bad. Let's validate that.
* skb->csum is no longer the full packet checksum,
* so don't treat is as such.
*/
skb_checksum_complete_unset(skb);
}

return 0;
return (__force int)skb_checksum_init_zero_check(skb, proto, uh->check,
ip6_compute_pseudo);
}
EXPORT_SYMBOL(udp6_csum_init);

Expand Down

0 comments on commit 5ca4ac2

Please sign in to comment.