瀏覽代碼

[IPV6]: Adjust inet6_exit() cleanup sequence against inet6_init()

This patch for adjust inet6_exit() to inverse sequence to inet6_init().

At ipv6_init, it first create proc_root/net/dev_snmp6 entry by call
ipv6_misc_proc_init(), then call addrconf_init() to create the corresponding
device entry at this directory, but at inet6_exit, ipv6_misc_proc_exit()
called first, then call addrconf_init().

Signed-off-by: Joe Jin <joe.jin@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Joe Jin 18 年之前
父節點
當前提交
ca17c23345
共有 1 個文件被更改,包括 14 次插入10 次删除
  1. 14 10
      net/ipv6/af_inet6.c

+ 14 - 10
net/ipv6/af_inet6.c

@@ -929,25 +929,28 @@ static void __exit inet6_exit(void)
 {
 {
 	/* First of all disallow new sockets creation. */
 	/* First of all disallow new sockets creation. */
 	sock_unregister(PF_INET6);
 	sock_unregister(PF_INET6);
+
+	/* Cleanup code parts. */
+	ipv6_packet_cleanup();
+#ifdef CONFIG_IPV6_MIP6
+	mip6_fini();
+#endif
+	addrconf_cleanup();
+	ip6_flowlabel_cleanup();
+	ip6_route_cleanup();
 #ifdef CONFIG_PROC_FS
 #ifdef CONFIG_PROC_FS
+
+	/* Cleanup code parts. */
 	if6_proc_exit();
 	if6_proc_exit();
 	ac6_proc_exit();
 	ac6_proc_exit();
 	ipv6_misc_proc_exit();
 	ipv6_misc_proc_exit();
-	udp6_proc_exit();
 	udplite6_proc_exit();
 	udplite6_proc_exit();
+	udp6_proc_exit();
 	tcp6_proc_exit();
 	tcp6_proc_exit();
 	raw6_proc_exit();
 	raw6_proc_exit();
 #endif
 #endif
-#ifdef CONFIG_IPV6_MIP6
-	mip6_fini();
-#endif
-	/* Cleanup code parts. */
-	ip6_flowlabel_cleanup();
-	addrconf_cleanup();
-	ip6_route_cleanup();
-	ipv6_packet_cleanup();
-	igmp6_cleanup();
 	ipv6_netfilter_fini();
 	ipv6_netfilter_fini();
+	igmp6_cleanup();
 	ndisc_cleanup();
 	ndisc_cleanup();
 	icmpv6_cleanup();
 	icmpv6_cleanup();
 #ifdef CONFIG_SYSCTL
 #ifdef CONFIG_SYSCTL
@@ -955,6 +958,7 @@ static void __exit inet6_exit(void)
 #endif
 #endif
 	cleanup_ipv6_mibs();
 	cleanup_ipv6_mibs();
 	proto_unregister(&rawv6_prot);
 	proto_unregister(&rawv6_prot);
+	proto_unregister(&udplitev6_prot);
 	proto_unregister(&udpv6_prot);
 	proto_unregister(&udpv6_prot);
 	proto_unregister(&tcpv6_prot);
 	proto_unregister(&tcpv6_prot);
 }
 }