patch-2.1.122 linux/net/ipv6/af_inet6.c

Next file: linux/net/ipv6/tcp_ipv6.c
Previous file: linux/net/ipv4/udp.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.121/linux/net/ipv6/af_inet6.c linux/net/ipv6/af_inet6.c
@@ -7,7 +7,7 @@
  *
  *	Adapted from linux/net/ipv4/af_inet.c
  *
- *	$Id: af_inet6.c,v 1.37 1998/08/26 12:04:45 davem Exp $
+ *	$Id: af_inet6.c,v 1.38 1998/09/15 02:11:45 davem Exp $
  *
  *	This program is free software; you can redistribute it and/or
  *      modify it under the terms of the GNU General Public License
@@ -54,6 +54,15 @@
 #include <asm/uaccess.h>
 #include <asm/system.h>
 
+static int unloadable = 0; /* XX: Turn to one when all is ok within the
+			      module for allowing unload */
+
+#if defined(MODULE) && LINUX_VERSION_CODE > 0x20115
+MODULE_AUTHOR("Cast of dozens");
+MODULE_DESCRIPTION("IPv6 protocol stack for Linux");
+MODULE_PARM(unloadable, "i");
+#endif
+
 extern struct proto_ops inet6_stream_ops;
 extern struct proto_ops inet6_dgram_ops;
 
@@ -463,6 +472,7 @@
 #ifdef MODULE
 int ipv6_unload(void)
 {
+	if (!unloadable) return 1;
 	/* We keep internally 3 raw sockets */
 	return __this_module.usecount - 3;
 }

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