Skip to content

Commit 8ce4406

Browse files
Cong Wangdavem330
authored andcommitted
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 <[email protected]> Cc: Stephen Hemminger <[email protected]> Cc: David S. Miller <[email protected]> Signed-off-by: Cong Wang <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent b0983d3 commit 8ce4406

File tree

1 file changed

+0
-48
lines changed

1 file changed

+0
-48
lines changed

net/ipv6/af_inet6.c

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,52 +1028,4 @@ static int __init inet6_init(void)
10281028
}
10291029
module_init(inet6_init);
10301030

1031-
static 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-
}
1077-
module_exit(inet6_exit);
1078-
10791031
MODULE_ALIAS_NETPROTO(PF_INET6);

0 commit comments

Comments
 (0)