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

Next file: linux/drivers/net/tunnel.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.5/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 = alloc_skb(pkt_len, GFP_ATOMIC);
+			skb = dev_alloc_skb(pkt_len);
 			if (skb == NULL) {
 				printk("%s: Memory squeeze, deferring packet.\n", dev->name);
 				/* Check that at least two ring entries are free.
@@ -616,9 +616,8 @@
 				}
 				break;
 			}
-			skb->len = pkt_len;
 			skb->dev = dev;
-			memcpy(skb->data, lp->rx_ring[entry].buffer1, pkt_len);
+			memcpy(skb_put(skb,pkt_len), lp->rx_ring[entry].buffer1, pkt_len);
 			skb->protocol=eth_type_trans(skb,dev);
 			netif_rx(skb);
 			lp->stats.rx_packets++;

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