Skip to content

Commit

Permalink
virtio_net: Fix IP alignment on non-mergeable RX path
Browse files Browse the repository at this point in the history
We need to enforce the IP alignment on the non-mergeable RX path just
like the other RX path.  Not doing so results in misaligned IP
headers.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Herbert Xu authored and David S. Miller committed Jun 12, 2009
1 parent adf76cf commit 8981f01
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/net/virtio_net.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,10 +283,11 @@ static void try_fill_recv_maxbufs(struct virtnet_info *vi)
for (;;) {
struct virtio_net_hdr *hdr;

skb = netdev_alloc_skb(vi->dev, MAX_PACKET_LEN);
skb = netdev_alloc_skb(vi->dev, MAX_PACKET_LEN + NET_IP_ALIGN);
if (unlikely(!skb))
break;

skb_reserve(skb, NET_IP_ALIGN);
skb_put(skb, MAX_PACKET_LEN);

hdr = skb_vnet_hdr(skb);
Expand Down

0 comments on commit 8981f01

Please sign in to comment.