Skip to contentSkip to conversation

sky2: incorrect length on receive packets

PATCH Applied Stephen Hemminger 2 participants 2 messages Oct 3, 2006 – Oct 5, 2006

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sky2: incorrect length on receive packets

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.

---
 drivers/net/sky2.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/sky2.c +2 -2
@@ -1907,7 +1907,7 @@
 		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 @@
 	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;
 }