aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/vmxnet3/vmxnet3_drv.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c
index f47db1cc766f..a1632a995380 100644
--- a/drivers/net/vmxnet3/vmxnet3_drv.c
+++ b/drivers/net/vmxnet3/vmxnet3_drv.c
@@ -807,30 +807,25 @@ vmxnet3_parse_and_copy_hdr(struct sk_buff *skb, struct vmxnet3_tx_queue *tq,
807 skb_transport_header(skb))->doff * 4; 807 skb_transport_header(skb))->doff * 4;
808 ctx->copy_size = ctx->eth_ip_hdr_size + ctx->l4_hdr_size; 808 ctx->copy_size = ctx->eth_ip_hdr_size + ctx->l4_hdr_size;
809 } else { 809 } else {
810 unsigned int pull_size;
811
812 if (skb->ip_summed == CHECKSUM_PARTIAL) { 810 if (skb->ip_summed == CHECKSUM_PARTIAL) {
813 ctx->eth_ip_hdr_size = skb_checksum_start_offset(skb); 811 ctx->eth_ip_hdr_size = skb_checksum_start_offset(skb);
814 812
815 if (ctx->ipv4) { 813 if (ctx->ipv4) {
816 struct iphdr *iph = (struct iphdr *) 814 struct iphdr *iph = (struct iphdr *)
817 skb_network_header(skb); 815 skb_network_header(skb);
818 if (iph->protocol == IPPROTO_TCP) { 816 if (iph->protocol == IPPROTO_TCP)
819 pull_size = ctx->eth_ip_hdr_size +
820 sizeof(struct tcphdr);
821
822 if (unlikely(!pskb_may_pull(skb,
823 pull_size))) {
824 goto err;
825 }
826 ctx->l4_hdr_size = ((struct tcphdr *) 817 ctx->l4_hdr_size = ((struct tcphdr *)
827 skb_transport_header(skb))->doff * 4; 818 skb_transport_header(skb))->doff * 4;
828 } else if (iph->protocol == IPPROTO_UDP) { 819 else if (iph->protocol == IPPROTO_UDP)
820 /*
821 * Use tcp header size so that bytes to
822 * be copied are more than required by
823 * the device.
824 */
829 ctx->l4_hdr_size = 825 ctx->l4_hdr_size =
830 sizeof(struct udphdr); 826 sizeof(struct tcphdr);
831 } else { 827 else
832 ctx->l4_hdr_size = 0; 828 ctx->l4_hdr_size = 0;
833 }
834 } else { 829 } else {
835 /* for simplicity, don't copy L4 headers */ 830 /* for simplicity, don't copy L4 headers */
836 ctx->l4_hdr_size = 0; 831 ctx->l4_hdr_size = 0;