patch-2.1.116 linux/net/core/dev.c

Next file: linux/net/core/sock.c
Previous file: linux/net/ax25/af_ax25.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.115/linux/net/core/dev.c linux/net/core/dev.c
@@ -740,21 +740,20 @@
 		 *	recovering the MAC header first.
 		 */
 		
-		int offset=skb->data-skb->mac.raw;
-		cli();
+		int offset;
+
+		skb=skb_clone(skb, GFP_ATOMIC);
+		if(skb==NULL)		
+			return;
+			
+		offset=skb->data-skb->mac.raw;
 		skb_push(skb,offset);	/* Put header back on for bridge */
+
 		if(br_receive_frame(skb))
-		{
-			sti();
 			return;
-		}
-		/*
-		 *	Pull the MAC header off for the copy going to
-		 *	the upper layers.
-		 */
-		skb_pull(skb,offset);
-		sti();
+		kfree_skb(skb, FREE_READ);
 	}
+	return;
 }
 #endif
 
@@ -809,7 +808,7 @@
 
 	while (!skb_queue_empty(&backlog)) 
 	{
-		struct sk_buff * skb = backlog.next;
+		struct sk_buff * skb;
 
 		/* Give chance to other bottom halves to run */
 		if (jiffies - start_time > 1)
@@ -818,9 +817,7 @@
 		/*
 		 *	We have a packet. Therefore the queue has shrunk
 		 */
-		cli();
-		__skb_unlink(skb, &backlog);
-		sti();
+		skb = skb_dequeue(&backlog);
 
 #ifdef CONFIG_CPU_IS_SLOW
 		if (ave_busy > 128*16) {

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov