diff options
Diffstat (limited to 'drivers/net/virtio_net.c')
-rw-r--r-- | drivers/net/virtio_net.c | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 5413dbf3d4ac..a60505c8f82a 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c | |||
@@ -83,17 +83,8 @@ static void receive_skb(struct net_device *dev, struct sk_buff *skb, | |||
83 | 83 | ||
84 | if (hdr->flags & VIRTIO_NET_HDR_F_NEEDS_CSUM) { | 84 | if (hdr->flags & VIRTIO_NET_HDR_F_NEEDS_CSUM) { |
85 | pr_debug("Needs csum!\n"); | 85 | pr_debug("Needs csum!\n"); |
86 | skb->ip_summed = CHECKSUM_PARTIAL; | 86 | if (!skb_partial_csum_set(skb,hdr->csum_start,hdr->csum_offset)) |
87 | skb->csum_start = hdr->csum_start; | ||
88 | skb->csum_offset = hdr->csum_offset; | ||
89 | if (skb->csum_start > skb->len - 2 | ||
90 | || skb->csum_offset > skb->len - 2) { | ||
91 | if (net_ratelimit()) | ||
92 | printk(KERN_WARNING "%s: csum=%u/%u len=%u\n", | ||
93 | dev->name, skb->csum_start, | ||
94 | skb->csum_offset, skb->len); | ||
95 | goto frame_err; | 87 | goto frame_err; |
96 | } | ||
97 | } | 88 | } |
98 | 89 | ||
99 | if (hdr->gso_type != VIRTIO_NET_HDR_GSO_NONE) { | 90 | if (hdr->gso_type != VIRTIO_NET_HDR_GSO_NONE) { |