Commit 8f5c8c63 authored by Alexander Viro's avatar Alexander Viro Committed by Benjamin Herrenschmidt

[IPV6]: Kill MODULE ifdeffing, common init for sysctls.

parent 62bc1c6d
...@@ -3355,8 +3355,7 @@ void __init addrconf_init(void) ...@@ -3355,8 +3355,7 @@ void __init addrconf_init(void)
#endif #endif
} }
#ifdef MODULE void __exit addrconf_cleanup(void)
void addrconf_cleanup(void)
{ {
struct net_device *dev; struct net_device *dev;
struct inet6_dev *idev; struct inet6_dev *idev;
...@@ -3417,5 +3416,3 @@ void addrconf_cleanup(void) ...@@ -3417,5 +3416,3 @@ void addrconf_cleanup(void)
proc_net_remove("if_inet6"); proc_net_remove("if_inet6");
#endif #endif
} }
#endif /* MODULE */
...@@ -90,11 +90,6 @@ extern int if6_proc_init(void); ...@@ -90,11 +90,6 @@ extern int if6_proc_init(void);
extern void if6_proc_exit(void); extern void if6_proc_exit(void);
#endif #endif
#ifdef CONFIG_SYSCTL
extern void ipv6_sysctl_register(void);
extern void ipv6_sysctl_unregister(void);
#endif
int sysctl_ipv6_bindv6only; int sysctl_ipv6_bindv6only;
#ifdef INET_REFCNT_DEBUG #ifdef INET_REFCNT_DEBUG
...@@ -573,7 +568,7 @@ int ipv6_unload(void) ...@@ -573,7 +568,7 @@ int ipv6_unload(void)
#endif #endif
#endif #endif
#if defined(MODULE) && defined(CONFIG_SYSCTL) #ifdef CONFIG_SYSCTL
extern void ipv6_sysctl_register(void); extern void ipv6_sysctl_register(void);
extern void ipv6_sysctl_unregister(void); extern void ipv6_sysctl_unregister(void);
#endif #endif
...@@ -784,7 +779,7 @@ static int __init inet6_init(void) ...@@ -784,7 +779,7 @@ static int __init inet6_init(void)
* able to communicate via both network protocols. * able to communicate via both network protocols.
*/ */
#if defined(MODULE) && defined(CONFIG_SYSCTL) #ifdef CONFIG_SYSCTL
ipv6_sysctl_register(); ipv6_sysctl_register();
#endif #endif
err = icmpv6_init(&inet6_family_ops); err = icmpv6_init(&inet6_family_ops);
...@@ -859,7 +854,7 @@ static int __init inet6_init(void) ...@@ -859,7 +854,7 @@ static int __init inet6_init(void)
ndisc_fail: ndisc_fail:
icmpv6_cleanup(); icmpv6_cleanup();
icmp_fail: icmp_fail:
#if defined(MODULE) && defined(CONFIG_SYSCTL) #ifdef CONFIG_SYSCTL
ipv6_sysctl_unregister(); ipv6_sysctl_unregister();
#endif #endif
cleanup_ipv6_mibs(); cleanup_ipv6_mibs();
...@@ -868,9 +863,7 @@ static int __init inet6_init(void) ...@@ -868,9 +863,7 @@ static int __init inet6_init(void)
} }
module_init(inet6_init); module_init(inet6_init);
static void __exit inet6_exit(void)
#ifdef MODULE
static void 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);
...@@ -903,6 +896,5 @@ static void inet6_exit(void) ...@@ -903,6 +896,5 @@ static void inet6_exit(void)
kmem_cache_destroy(raw6_sk_cachep); kmem_cache_destroy(raw6_sk_cachep);
} }
module_exit(inet6_exit); module_exit(inet6_exit);
#endif /* MODULE */
MODULE_ALIAS_NETPROTO(PF_INET6); MODULE_ALIAS_NETPROTO(PF_INET6);
...@@ -1241,12 +1241,8 @@ void __init fib6_init(void) ...@@ -1241,12 +1241,8 @@ void __init fib6_init(void)
NULL, NULL); NULL, NULL);
} }
#ifdef MODULE void __exit fib6_gc_cleanup(void)
void fib6_gc_cleanup(void)
{ {
del_timer(&ip6_fib_timer); del_timer(&ip6_fib_timer);
kmem_cache_destroy(fib6_node_kmem); kmem_cache_destroy(fib6_node_kmem);
} }
#endif
...@@ -680,24 +680,12 @@ int ipv6_getsockopt(struct sock *sk, int level, int optname, char *optval, ...@@ -680,24 +680,12 @@ int ipv6_getsockopt(struct sock *sk, int level, int optname, char *optval,
return 0; return 0;
} }
#if defined(MODULE) && defined(CONFIG_SYSCTL)
/*
* sysctl registration functions defined in sysctl_net_ipv6.c
*/
extern void ipv6_sysctl_register(void);
extern void ipv6_sysctl_unregister(void);
#endif
void __init ipv6_packet_init(void) void __init ipv6_packet_init(void)
{ {
dev_add_pack(&ipv6_packet_type); dev_add_pack(&ipv6_packet_type);
} }
#ifdef MODULE void __exit ipv6_packet_cleanup(void)
void ipv6_packet_cleanup(void)
{ {
dev_remove_pack(&ipv6_packet_type); dev_remove_pack(&ipv6_packet_type);
} }
#endif
...@@ -2001,8 +2001,7 @@ void __init ip6_route_init(void) ...@@ -2001,8 +2001,7 @@ void __init ip6_route_init(void)
#endif #endif
} }
#ifdef MODULE void __exit ip6_route_cleanup(void)
void ip6_route_cleanup(void)
{ {
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
proc_net_remove("ipv6_route"); proc_net_remove("ipv6_route");
...@@ -2015,4 +2014,3 @@ void ip6_route_cleanup(void) ...@@ -2015,4 +2014,3 @@ void ip6_route_cleanup(void)
fib6_gc_cleanup(); fib6_gc_cleanup();
kmem_cache_destroy(ip6_dst_ops.kmem_cachep); kmem_cache_destroy(ip6_dst_ops.kmem_cachep);
} }
#endif /* MODULE */
...@@ -805,13 +805,11 @@ static struct inet_protocol sit_protocol = { ...@@ -805,13 +805,11 @@ static struct inet_protocol sit_protocol = {
.err_handler = ipip6_err, .err_handler = ipip6_err,
}; };
#ifdef MODULE void __exit sit_cleanup(void)
void sit_cleanup(void)
{ {
inet_del_protocol(&sit_protocol, IPPROTO_IPV6); inet_del_protocol(&sit_protocol, IPPROTO_IPV6);
unregister_netdev(ipip6_fb_tunnel_dev); unregister_netdev(ipip6_fb_tunnel_dev);
} }
#endif
int __init sit_init(void) int __init sit_init(void)
{ {
......
...@@ -79,7 +79,6 @@ ctl_table ipv6_table[] = { ...@@ -79,7 +79,6 @@ ctl_table ipv6_table[] = {
{ .ctl_name = 0 } { .ctl_name = 0 }
}; };
#ifdef MODULE
static struct ctl_table_header *ipv6_sysctl_header; static struct ctl_table_header *ipv6_sysctl_header;
static ctl_table ipv6_net_table[] = { static ctl_table ipv6_net_table[] = {
...@@ -111,7 +110,6 @@ void ipv6_sysctl_unregister(void) ...@@ -111,7 +110,6 @@ void ipv6_sysctl_unregister(void)
{ {
unregister_sysctl_table(ipv6_sysctl_header); unregister_sysctl_table(ipv6_sysctl_header);
} }
#endif /* MODULE */
#endif /* CONFIG_SYSCTL */ #endif /* CONFIG_SYSCTL */
......
...@@ -26,10 +26,6 @@ extern struct ctl_table core_table[]; ...@@ -26,10 +26,6 @@ extern struct ctl_table core_table[];
extern struct ctl_table ether_table[]; extern struct ctl_table ether_table[];
#endif #endif
#ifdef CONFIG_IPV6
extern struct ctl_table ipv6_table[];
#endif
#ifdef CONFIG_TR #ifdef CONFIG_TR
extern struct ctl_table tr_table[]; extern struct ctl_table tr_table[];
#endif #endif
...@@ -57,14 +53,6 @@ struct ctl_table net_table[] = { ...@@ -57,14 +53,6 @@ struct ctl_table net_table[] = {
.child = ipv4_table .child = ipv4_table
}, },
#endif #endif
#ifdef CONFIG_IPV6
{
.ctl_name = NET_IPV6,
.procname = "ipv6",
.mode = 0555,
.child = ipv6_table,
},
#endif
#ifdef CONFIG_TR #ifdef CONFIG_TR
{ {
.ctl_name = NET_TR, .ctl_name = NET_TR,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment