patch-2.3.15 linux/net/decnet/dn_nsp_out.c

Next file: linux/net/decnet/dn_raw.c
Previous file: linux/net/decnet/dn_nsp_in.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.14/linux/net/decnet/dn_nsp_out.c linux/net/decnet/dn_nsp_out.c
@@ -71,8 +71,7 @@
 /*
  * If sk == NULL, then we assume that we are supposed to be making
  * a routing layer skb. If sk != NULL, then we are supposed to be
- * creating an skb for the NSP layer. The dn_send_skb() function will
- * recognise skbs on the same basis. 
+ * creating an skb for the NSP layer.
  *
  * The eventual aim is for each socket to have a cached header size
  * for its outgoing packets, and to set hdr from this when sk != NULL.
@@ -86,9 +85,11 @@
 		return NULL;
 
 	skb->protocol = __constant_htons(ETH_P_DNA_RT);
-	skb->sk       = sk;
 	skb->pkt_type = PACKET_OUTGOING;
 
+	if (sk)
+		skb_set_owner_w(skb, sk);
+
 	skb_reserve(skb, hdr);
 
 	return skb;
@@ -149,9 +150,6 @@
 		if ((skb = dn_alloc_skb(sk, len, GFP_KERNEL)) == NULL)
 			continue;
 
-		skb->destructor = sock_wfree;
-		atomic_add(skb->truesize, &sk->wmem_alloc);
-
 		*size = len - 11;
 	}
 
@@ -253,7 +251,7 @@
 				cb->stamp = jiffies;
 			cb->xmit_count++;
 			skb2->sk = sk;
-			dn_send_skb(skb2);
+			dn_nsp_send(skb2);
 		}
 		skb = skb->next;
 		win--;
@@ -277,7 +275,7 @@
 				cb->stamp = jiffies;
 			cb->xmit_count++;
 			skb2->sk = sk;
-			dn_send_skb(skb2);
+			dn_nsp_send(skb2);
 		}
 		skb = skb->next;
 		win--;
@@ -340,7 +338,7 @@
 		cb->stamp = jiffies;
 		cb->xmit_count++;
 		skb2->sk = sk;
-		dn_send_skb(skb2);
+		dn_nsp_send(skb2);
 	}
 }
 
@@ -399,8 +397,8 @@
 
 void dn_nsp_send_data_ack(struct sock *sk)
 {
-	struct	sk_buff			*skb = NULL;
-	struct  nsp_data_ack_msg	*msg;
+	struct sk_buff *skb = NULL;
+	struct  nsp_data_ack_msg *msg;
 
 	if ((skb = dn_alloc_skb(sk, 200, GFP_ATOMIC)) == NULL)
 		return;
@@ -414,29 +412,27 @@
 
 	sk->protinfo.dn.ackxmt_dat = sk->protinfo.dn.numdat_rcv;
 
-	dn_send_skb(skb);
+	dn_nsp_send(skb);
 }
 
 void dn_nsp_send_oth_ack(struct sock *sk)
 {
-	struct	sk_buff			*skb = NULL;
-	struct  nsp_data_ack_msg		*msg;
+	struct sk_buff *skb = NULL;
+	struct  nsp_data_ack_msg *msg;
 
 	if ((skb = dn_alloc_skb(sk, 200, GFP_ATOMIC)) == NULL)
 		return;
 	
-	/* printk(KERN_DEBUG "dn_send_oth_ack\n"); */
-
 	msg = (struct nsp_data_ack_msg *)skb_put(skb,sizeof(*msg));
 
-	msg->msgflg = 0x14;			/* oth ack message	*/
+	msg->msgflg = 0x14;	/* oth ack message	*/
 	msg->dstaddr = sk->protinfo.dn.addrrem;
 	msg->srcaddr = sk->protinfo.dn.addrloc;
 	msg->acknum  = dn_htons((sk->protinfo.dn.numoth_rcv & 0x0FFF) | 0x8000);
 
 	sk->protinfo.dn.ackxmt_oth = sk->protinfo.dn.numoth_rcv;
 
-	dn_send_skb(skb);
+	dn_nsp_send(skb);
 }
 
 
@@ -453,7 +449,7 @@
         msg->msgflg = 0x24;                   
 	msg->dstaddr = scp->addrrem;
 
-	dn_send_skb(skb);	
+	dn_nsp_send(skb);	
 }
 
 void dn_nsp_delayed_ack(struct sock *sk)
@@ -492,7 +488,7 @@
 	}
 	
 
-	dn_send_skb(skb);	
+	dn_nsp_send(skb);	
 }
 
 void dn_send_disc (struct sock *sk, unsigned char msgflg, unsigned short reason)
@@ -522,7 +518,7 @@
 		memcpy(msg, scp->discdata_out.opt_data, scp->discdata_out.opt_optl);
 	}
 
-	dn_send_skb(skb);	
+	dn_nsp_send(skb);	
 }
 
 void dn_nsp_send_lnk(struct sock *sk, unsigned short flgs)
@@ -587,9 +583,6 @@
 	msg->msgflg	= msgflg;
 	msg->dstaddr	= 0x0000;		/* Remote Node will assign it*/
 
-	if (msgflg == NSP_CI)
-		sk->protinfo.dn.addrloc = dn_alloc_port();
-
 	msg->srcaddr	= sk->protinfo.dn.addrloc;
 	msg->services	= 1 | NSP_FC_NONE;	/* Requested flow control    */
 	msg->info	= 0x03;			/* Version Number            */	
@@ -634,6 +627,6 @@
 
 	cb->rt_flags = DN_RT_F_RQR;
 
-	dn_send_skb(skb);	
+	dn_nsp_send(skb);	
 }
 

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