patch-1.3.7 linux/drivers/net/tulip.c

Next file: linux/drivers/net/wavelan.c
Previous file: linux/drivers/net/slip.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v1.3.6/linux/drivers/net/tulip.c linux/drivers/net/tulip.c
@@ -600,7 +600,7 @@
 			short pkt_len = lp->rx_ring[entry].status >> 16;
 			struct sk_buff *skb;
 
-			skb = dev_alloc_skb(pkt_len);
+			skb = dev_alloc_skb(pkt_len+2);
 			if (skb == NULL) {
 				printk("%s: Memory squeeze, deferring packet.\n", dev->name);
 				/* Check that at least two ring entries are free.
@@ -617,6 +617,7 @@
 				break;
 			}
 			skb->dev = dev;
+			skb_reserve(skb,2);	/* 16 byte align the data fields */
 			memcpy(skb_put(skb,pkt_len), lp->rx_ring[entry].buffer1, pkt_len);
 			skb->protocol=eth_type_trans(skb,dev);
 			netif_rx(skb);

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this