aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/virtio_net.c
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2009-06-03 20:59:18 -0400
committerDavid S. Miller <davem@davemloft.net>2009-06-08 03:19:11 -0400
commitb82f08ea162edeee6c2c70c6c4321bea4763fa35 (patch)
treec8f18af83b66604eeac54884871c7ffe91b37d46 /drivers/net/virtio_net.c
parent1feede014bf3c58f60b35f91dcd8a2f89b3908ad (diff)
virtio_net: Set correct gso->hdr_len
Through a bug in the tun driver, I noticed that virtio_net is producing bogus hdr_len values. In particular, it only includes the IP header in the linear area, and excludes the entire TCP header. This causes the TCP header to be copied twice for each packet. (The bug omitted the second copy :) This patch corrects this. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/virtio_net.c')
-rw-r--r--drivers/net/virtio_net.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 0c9ca67f66e6..09bd4410fa65 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -470,7 +470,7 @@ static int xmit_skb(struct virtnet_info *vi, struct sk_buff *skb)
470 } 470 }
471 471
472 if (skb_is_gso(skb)) { 472 if (skb_is_gso(skb)) {
473 hdr->hdr_len = skb_transport_header(skb) - skb->data; 473 hdr->hdr_len = skb_headlen(skb);
474 hdr->gso_size = skb_shinfo(skb)->gso_size; 474 hdr->gso_size = skb_shinfo(skb)->gso_size;
475 if (skb_shinfo(skb)->gso_type & SKB_GSO_TCPV4) 475 if (skb_shinfo(skb)->gso_type & SKB_GSO_TCPV4)
476 hdr->gso_type = VIRTIO_NET_HDR_GSO_TCPV4; 476 hdr->gso_type = VIRTIO_NET_HDR_GSO_TCPV4;