Re: why network devices don't do reference counting? (Re: [PATCH] Module use count must be updated as bridges are created/destroyed)

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Helge Hafting <helge.hafting@...>
Cc: Jan Engelhardt <jengelh@...>, Oleg Verych <olecom@...>, Jan Beulich <jbeulich@...>, <bridge@...>, <linux-kernel@...>
Date: Thursday, September 27, 2007 - 10:51 am

On Thu, 27 Sep 2007 13:54:23 +0200
Helge Hafting <helge.hafting@aitel.hist.no> wrote:


You need every socket to close and all routes to go away including the routes through
loopback device, and still there probably are control sockets buried inside ipv6
that hold ref count.

IMHO the kernel should just admit that IPV6 can't be removed.

--- a/net/ipv6/af_inet6.c	2007-09-26 16:28:01.000000000 -0700
+++ b/net/ipv6/af_inet6.c	2007-09-26 17:38:23.000000000 -0700
@@ -914,6 +914,9 @@ out_unregister_tcp_proto:
 }
 module_init(inet6_init);
 
+/* Disabled at present because it is impossible to remove all references */
+#ifdef IPV6_UNLOAD
+
 static void __exit inet6_exit(void)
 {
 	/* First of all disallow new sockets creation. */
@@ -952,5 +955,6 @@ static void __exit inet6_exit(void)
 	proto_unregister(&tcpv6_prot);
 }
 module_exit(inet6_exit);
+#endif
 
 MODULE_ALIAS_NETPROTO(PF_INET6);
--- a/net/ipv6/addrconf.c	2007-09-26 15:07:35.000000000 -0700
+++ b/net/ipv6/addrconf.c	2007-09-26 17:36:52.000000000 -0700
@@ -4255,6 +4255,7 @@ errout:
 	return err;
 }
 
+#ifdef IPV6_UNLOAD
 void __exit addrconf_cleanup(void)
 {
 	struct net_device *dev;
@@ -4308,3 +4309,4 @@ void __exit addrconf_cleanup(void)
 	proc_net_remove(&init_net, "if_inet6");
 #endif
 }
+#endif
--- a/net/ipv6/ipv6_sockglue.c	2007-09-26 15:07:35.000000000 -0700
+++ b/net/ipv6/ipv6_sockglue.c	2007-09-26 17:36:17.000000000 -0700
@@ -1132,7 +1132,9 @@ void __init ipv6_packet_init(void)
 	dev_add_pack(&ipv6_packet_type);
 }
 
-void ipv6_packet_cleanup(void)
+#ifdef IPV6_UNLOAD
+void __exit ipv6_packet_cleanup(void)
 {
 	dev_remove_pack(&ipv6_packet_type);
 }
+#endif
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH] Module use count must be updated as bridges are ..., Stephen Hemminger, (Wed Sep 26, 11:37 am)
Re: why network devices don't do reference counting? (Re: [P..., Stephen Hemminger, (Wed Sep 26, 5:06 pm)
Re: why network devices don't do reference counting? (Re: [P..., Stephen Hemminger, (Wed Sep 26, 6:33 pm)
Re: why network devices don't do reference counting?, David Miller, (Thu Sep 27, 3:01 pm)
Re: why network devices don't do reference counting? (Re: [P..., Stephen Hemminger, (Thu Sep 27, 10:51 am)
Re: why network devices don't do reference counting?, David Miller, (Thu Sep 27, 3:15 pm)
Re: why network devices don't do reference counting?, David Miller, (Wed Sep 26, 6:57 pm)