patch-pre2.0.13 linux/net/core/dev.c

Next file: linux/net/core/skbuff.c
Previous file: linux/net/Config.in
Back to the patch index
Back to the overall index

diff -u --recursive --new-file pre2.0.12/linux/net/core/dev.c linux/net/core/dev.c
@@ -413,14 +413,8 @@
 				dev_kfree_skb(skb, FREE_WRITE);
 				return;
 			}
-			cli();
-			skb_device_unlock(skb);		/* Buffer is on the device queue and can be freed safely */
-			__skb_queue_tail(list, skb);
-			skb = __skb_dequeue(list);
-			skb_device_lock(skb);		/* New buffer needs locking down */
-			restore_flags(flags);
 		}
-		
+
 		/* copy outgoing packets to any sniffer packet handlers */
 		if (dev_nit) {
 			struct packet_type *ptype;
@@ -441,6 +435,15 @@
 					ptype->func(skb2, skb->dev, ptype);
 				}
 			}
+		}
+
+		if (skb_queue_len(list)) {
+			cli();
+			skb_device_unlock(skb);		/* Buffer is on the device queue and can be freed safely */
+			__skb_queue_tail(list, skb);
+			skb = __skb_dequeue(list);
+			skb_device_lock(skb);		/* New buffer needs locking down */
+			restore_flags(flags);
 		}
 	}
 	if (dev->hard_start_xmit(skb, dev) == 0) {

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