aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/af_inet6.c
diff options
context:
space:
mode:
authorCong Wang <amwang@redhat.com>2013-09-20 23:12:21 -0400
committerDavid S. Miller <davem@davemloft.net>2013-09-24 11:31:58 -0400
commit8ce440610357b77587433d0df647cea69a6890a8 (patch)
treeb4635969ea9ed57f857a1b835328e37052e9bdc4 /net/ipv6/af_inet6.c
parentb0983d3c9b132c33b6fb2e28d157a1edc18a173c (diff)
ipv6: do not allow ipv6 module to be removed
There was some bug report on ipv6 module removal path before. Also, as Stephen pointed out, after vxlan module gets ipv6 support, the ipv6 stub it used is not safe against this module removal either. So, let's just remove inet6_exit() so that ipv6 module will not be able to be unloaded. Cc: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org> Cc: Stephen Hemminger <stephen@networkplumber.org> Cc: David S. Miller <davem@davemloft.net> Signed-off-by: Cong Wang <amwang@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/af_inet6.c')
-rw-r--r--net/ipv6/af_inet6.c48
1 files changed, 0 insertions, 48 deletions
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
index 7c96100b021e..4966b124dc2e 100644
--- a/net/ipv6/af_inet6.c
+++ b/net/ipv6/af_inet6.c
@@ -1028,52 +1028,4 @@ out_unregister_tcp_proto:
1028} 1028}
1029module_init(inet6_init); 1029module_init(inet6_init);
1030 1030
1031static void __exit inet6_exit(void)
1032{
1033 if (disable_ipv6_mod)
1034 return;
1035
1036 /* First of all disallow new sockets creation. */
1037 sock_unregister(PF_INET6);
1038 /* Disallow any further netlink messages */
1039 rtnl_unregister_all(PF_INET6);
1040
1041 udpv6_exit();
1042 udplitev6_exit();
1043 tcpv6_exit();
1044
1045 /* Cleanup code parts. */
1046 ipv6_packet_cleanup();
1047 ipv6_frag_exit();
1048 ipv6_exthdrs_exit();
1049 addrconf_cleanup();
1050 ip6_flowlabel_cleanup();
1051 ndisc_late_cleanup();
1052 ip6_route_cleanup();
1053#ifdef CONFIG_PROC_FS
1054
1055 /* Cleanup code parts. */
1056 if6_proc_exit();
1057 ipv6_misc_proc_exit();
1058 udplite6_proc_exit();
1059 raw6_proc_exit();
1060#endif
1061 ipv6_netfilter_fini();
1062 ipv6_stub = NULL;
1063 igmp6_cleanup();
1064 ndisc_cleanup();
1065 ip6_mr_cleanup();
1066 icmpv6_cleanup();
1067 rawv6_exit();
1068
1069 unregister_pernet_subsys(&inet6_net_ops);
1070 proto_unregister(&rawv6_prot);
1071 proto_unregister(&udplitev6_prot);
1072 proto_unregister(&udpv6_prot);
1073 proto_unregister(&tcpv6_prot);
1074
1075 rcu_barrier(); /* Wait for completion of call_rcu()'s */
1076}
1077module_exit(inet6_exit);
1078
1079MODULE_ALIAS_NETPROTO(PF_INET6); 1031MODULE_ALIAS_NETPROTO(PF_INET6);