patch-2.4.0-test11 linux/net/decnet/af_decnet.c

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

diff -u --recursive --new-file v2.4.0-test10/linux/net/decnet/af_decnet.c linux/net/decnet/af_decnet.c
@@ -33,6 +33,8 @@
  *         David S. Miller: New socket locking
  *        Steve Whitehouse: Socket list hashing/locking
  *         Arnaldo C. Melo: use capable, not suser
+ *        Steve Whitehouse: Removed unused code. Fix to use sk->allocation
+ *                          when required.
  */
 
 
@@ -538,7 +540,7 @@
 
 	switch(scp->state) {
 		case DN_DN:
-			dn_nsp_send_disc(sk, NSP_DISCCONF, NSP_REASON_DC, GFP_KERNEL);
+			dn_nsp_send_disc(sk, NSP_DISCCONF, NSP_REASON_DC, sk->allocation);
 			scp->persist_fxn = dn_destroy_timer;
 			scp->persist = dn_nsp_persist(sk);
 			break;
@@ -550,7 +552,7 @@
 		case DN_DI:
 		case DN_DR:
 disc_reject:
-			dn_nsp_send_disc(sk, NSP_DISCINIT, 0, GFP_KERNEL);
+			dn_nsp_send_disc(sk, NSP_DISCINIT, 0, sk->allocation);
 		case DN_NC:
 		case DN_NR:
 		case DN_RJ:
@@ -967,7 +969,7 @@
 
 	cb = (struct dn_skb_cb *)skb->cb;
 
-	if ((newsk = dn_alloc_sock(newsock, GFP_KERNEL)) == NULL) {
+	if ((newsk = dn_alloc_sock(newsock, sk->allocation)) == NULL) {
 		release_sock(sk);
 		kfree_skb(skb);
 		return -ENOBUFS;
@@ -1031,7 +1033,7 @@
 
 	if (newsk->protinfo.dn.accept_mode == ACC_IMMED) {
 		newsk->protinfo.dn.state = DN_CC;
-        	dn_send_conn_conf(newsk, GFP_KERNEL);
+        	dn_send_conn_conf(newsk, newsk->allocation);
 		err = dn_wait_accept(newsock, flags);
 	}
 
@@ -1388,7 +1390,7 @@
 				return -EINVAL;
 
 			scp->state = DN_CC;
-			dn_send_conn_conf(sk, GFP_KERNEL);
+			dn_send_conn_conf(sk, sk->allocation);
 			err = dn_wait_accept(sock, sock->file->f_flags);
 			return err;
 
@@ -1399,7 +1401,7 @@
 
 			scp->state = DN_DR;
 			sk->shutdown = SHUTDOWN_MASK;
-			dn_nsp_send_disc(sk, 0x38, 0, GFP_KERNEL);
+			dn_nsp_send_disc(sk, 0x38, 0, sk->allocation);
 			break;
 
 		default:
@@ -1527,7 +1529,7 @@
 
 		case DN_CR:
 			scp->state = DN_CC;
-			dn_send_conn_conf(sk, GFP_KERNEL);
+			dn_send_conn_conf(sk, sk->allocation);
 			return dn_wait_accept(sk->socket, (flags & MSG_DONTWAIT) ? O_NONBLOCK : 0);
 		case DN_CI:
 		case DN_CC:
@@ -2083,7 +2085,7 @@
 	dn_dn2eth(decnet_ether_address, dn_ntohs(decnet_address));
 #endif
 
-        printk(KERN_INFO "NET4: DECnet for Linux: V.2.3.49s (C) 1995-2000 Linux DECnet Project Team\n");
+        printk(KERN_INFO "NET4: DECnet for Linux: V.2.4.0-test10s (C) 1995-2000 Linux DECnet Project Team\n");
 
 	sock_register(&dn_family_ops);
 	dev_add_pack(&dn_dix_packet_type);
@@ -2102,6 +2104,14 @@
 #ifdef CONFIG_SYSCTL
 	dn_register_sysctl();
 #endif /* CONFIG_SYSCTL */
+
+	/*
+	 * Prevent DECnet module unloading until its fixed properly.
+	 * Requires an audit of the code to check for memory leaks and
+	 * initialisation problems etc.
+	 */
+	MOD_INC_USE_COUNT;
+
 	return 0;
 
 }
@@ -2111,7 +2121,6 @@
 {
 	unsigned short area = simple_strtoul(str, &str, 0);
 	unsigned short node = simple_strtoul(*str > 0 ? ++str : str, &str, 0);
-	/* unsigned short type = simple_strtoul(*str > 0 ? ++str : str, &str, 0); */
 
 	decnet_address = dn_htons(area << 10 | node);
 	dn_dn2eth(decnet_ether_address, dn_ntohs(decnet_address));

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