patch-2.3.99-pre6 linux/net/atm/clip.c

Next file: linux/net/atm/common.c
Previous file: linux/net/appletalk/ddp.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.99-pre5/linux/net/atm/clip.c linux/net/atm/clip.c
@@ -172,7 +172,7 @@
 	DPRINTK("clip_arp_rcv\n");
 	vcc = ATM_SKB(skb)->vcc;
 	if (!vcc || !atm_charge(vcc,skb->truesize)) {
-		kfree_skb(skb);
+		dev_kfree_skb_any(skb);
 		return 0;
 	}
 	DPRINTK("pushing to %p\n",vcc);
@@ -197,9 +197,8 @@
 	atm_return(vcc,skb->truesize);
 	skb->dev = clip_vcc->entry ? clip_vcc->entry->neigh->dev : clip_devs;
 		/* clip_vcc->entry == NULL if we don't have an IP address yet */
-	skb->rx_dev = NULL;
 	if (!skb->dev) {
-		kfree_skb(skb);
+		dev_kfree_skb_any(skb);
 		return;
 	}
 	ATM_SKB(skb)->vcc = vcc;
@@ -232,18 +231,20 @@
 static void clip_pop(struct atm_vcc *vcc,struct sk_buff *skb)
 {
 	struct clip_vcc *clip_vcc = CLIP_VCC(vcc);
+	struct net_device *dev = skb->dev;
 	int old;
+	unsigned long flags;
 
 	DPRINTK("clip_pop(vcc %p)\n",vcc);
 	clip_vcc->old_pop(vcc,skb);
 	/* skb->dev == NULL in outbound ARP packets */
-	if (!skb->dev) return;
-	spin_lock(&PRIV(skb->dev)->xoff_lock);
+	if (!dev) return;
+	spin_lock_irqsave(&PRIV(dev)->xoff_lock,flags);
 	if (atm_may_send(vcc,0)) {
 		old = xchg(&clip_vcc->xoff,0);
-		if (old) netif_wake_queue(skb->dev);
+		if (old) netif_wake_queue(dev);
 	}
-	spin_unlock(&PRIV(skb->dev)->xoff_lock);
+	spin_unlock_irqrestore(&PRIV(dev)->xoff_lock,flags);
 }
 
 
@@ -377,6 +378,7 @@
 	struct atmarp_entry *entry;
 	struct atm_vcc *vcc;
 	int old;
+	unsigned long flags;
 
 	DPRINTK("clip_start_xmit (skb %p)\n",skb);
 	if (!skb->dst) {
@@ -439,7 +441,7 @@
 		return 0;
 	}
 	if (old) return 0;
-	spin_lock(&clip_priv->xoff_lock);
+	spin_lock_irqsave(&clip_priv->xoff_lock,flags);
 	netif_stop_queue(dev); /* XOFF -> throttle immediately */
 	barrier();
 	if (!entry->vccs->xoff)
@@ -448,7 +450,7 @@
 		   good enough, because nothing should really be asleep because
 		   of the brief netif_stop_queue. If this isn't true or if it
 		   changes, use netif_wake_queue instead. */
-	spin_unlock(&clip_priv->xoff_lock);
+	spin_unlock_irqrestore(&clip_priv->xoff_lock,flags);
 	return 0;
 }
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)