[PATCH] sky2: incorrect length on receive packets
authorStephen Hemminger <shemminger@osdl.org>
Tue, 3 Oct 2006 23:39:12 +0000 (16:39 -0700)
committerJeff Garzik <jeff@garzik.org>
Thu, 5 Oct 2006 10:43:23 +0000 (06:43 -0400)
The previous change to do fragmented receive (post 2.6.18) introduced a bug
where packets are passed up with size set to the size of the receive buffer
not the actual received data.  IP silently trims this so it didn't show up
right away.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
drivers/net/sky2.c

index 396e7df3c61b8573017d829fe298b7f7b1ba1f9d..68515150ff3bcee427d2904428ad0fa185b95982 100644 (file)
@@ -1907,7 +1907,7 @@ static struct sk_buff *receive_copy(struct sky2_port *sky2,
                pci_dma_sync_single_for_device(sky2->hw->pdev, re->data_addr,
                                               length, PCI_DMA_FROMDEVICE);
                re->skb->ip_summed = CHECKSUM_NONE;
-               __skb_put(skb, length);
+               skb_put(skb, length);
        }
        return skb;
 }
@@ -1970,7 +1970,7 @@ static struct sk_buff *receive_new(struct sky2_port *sky2,
        if (skb_shinfo(skb)->nr_frags)
                skb_put_frags(skb, hdr_space, length);
        else
-               skb_put(skb, hdr_space);
+               skb_put(skb, length);
        return skb;
 }