patch: af_netlink rmmod problem

From: Herbert Rosmanith (herp@wildsau.idv-edu.uni-linz.ac.at)
Date: Tue Jun 26 2001 - 07:32:19 EST


hello,

when doing a series of insmod/rmmod of af_netlink, I noticed
/proc/net/netlink entries being added each time.

this small patch addresses the problem:

--- snip ---
bash-2.03# diff -u linux-2.4.5.orig/net/netlink/af_netlink.c linux-2.4.5.new/net/netlink/af_netlink.c
--- linux-2.4.5.orig/net/netlink/af_netlink.c Thu Apr 12 21:11:39 2001
+++ linux-2.4.5.new/net/netlink/af_netlink.c Tue Jun 26 14:41:25 2001
@@ -9,6 +9,9 @@
  * as published by the Free Software Foundation; either version
  * 2 of the License, or (at your option) any later version.
  *
+ * Tue Jun 26 14:36:48 MEST 2001 Herbert "herp" Rosmanith
+ * added netlink_proto_exit
+ *
  */
 
 #include <linux/config.h>
@@ -985,4 +988,11 @@
        return 0;
 }
 
+static void __exit netlink_proto_exit(void)
+{
+ sock_unregister(PF_NETLINK);
+ remove_proc_entry("net/netlink", NULL);
+}
+
 module_init(netlink_proto_init);
+module_exit(netlink_proto_exit);
--- snip ---

thanks,
h.rosmanith
herp@wildsau.idv.uni-linz.ac.at

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Jun 30 2001 - 21:00:14 EST