Commit ca17c23345308a8692a65a0cca363d9108a665ca
Committed by
David S. Miller
1 parent
d3f23dfe8b
Exists in
master
and in
7 other branches
[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>
Showing 1 changed file with 14 additions and 10 deletions Side-by-side Diff
net/ipv6/af_inet6.c
... | ... | @@ -929,25 +929,28 @@ |
929 | 929 | { |
930 | 930 | /* First of all disallow new sockets creation. */ |
931 | 931 | sock_unregister(PF_INET6); |
932 | + | |
933 | + /* Cleanup code parts. */ | |
934 | + ipv6_packet_cleanup(); | |
935 | +#ifdef CONFIG_IPV6_MIP6 | |
936 | + mip6_fini(); | |
937 | +#endif | |
938 | + addrconf_cleanup(); | |
939 | + ip6_flowlabel_cleanup(); | |
940 | + ip6_route_cleanup(); | |
932 | 941 | #ifdef CONFIG_PROC_FS |
942 | + | |
943 | + /* Cleanup code parts. */ | |
933 | 944 | if6_proc_exit(); |
934 | 945 | ac6_proc_exit(); |
935 | 946 | ipv6_misc_proc_exit(); |
936 | - udp6_proc_exit(); | |
937 | 947 | udplite6_proc_exit(); |
948 | + udp6_proc_exit(); | |
938 | 949 | tcp6_proc_exit(); |
939 | 950 | raw6_proc_exit(); |
940 | 951 | #endif |
941 | -#ifdef CONFIG_IPV6_MIP6 | |
942 | - mip6_fini(); | |
943 | -#endif | |
944 | - /* Cleanup code parts. */ | |
945 | - ip6_flowlabel_cleanup(); | |
946 | - addrconf_cleanup(); | |
947 | - ip6_route_cleanup(); | |
948 | - ipv6_packet_cleanup(); | |
949 | - igmp6_cleanup(); | |
950 | 952 | ipv6_netfilter_fini(); |
953 | + igmp6_cleanup(); | |
951 | 954 | ndisc_cleanup(); |
952 | 955 | icmpv6_cleanup(); |
953 | 956 | #ifdef CONFIG_SYSCTL |
... | ... | @@ -955,6 +958,7 @@ |
955 | 958 | #endif |
956 | 959 | cleanup_ipv6_mibs(); |
957 | 960 | proto_unregister(&rawv6_prot); |
961 | + proto_unregister(&udplitev6_prot); | |
958 | 962 | proto_unregister(&udpv6_prot); |
959 | 963 | proto_unregister(&tcpv6_prot); |
960 | 964 | } |