diff options
author | Brian Haley <brian.haley@hp.com> | 2009-06-01 06:07:33 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-06-01 06:07:33 -0400 |
commit | 56d417b12e57dfe11c9b7ba4bea3882c62a55815 (patch) | |
tree | 5f7d6fedc4370333898ef7790711e0a9c73e323d /net/ipv6/af_inet6.c | |
parent | 0220ff7fc35913dcd8cdf8fb3a0966caf4aed2f3 (diff) |
IPv6: Add 'autoconf' and 'disable_ipv6' module parameters
Add 'autoconf' and 'disable_ipv6' parameters to the IPv6 module.
The first controls if IPv6 addresses are autoconfigured from
prefixes received in Router Advertisements. The IPv6 loopback
(::1) and link-local addresses are still configured.
The second controls if IPv6 addresses are desired at all. No
IPv6 addresses will be added to any interfaces.
Signed-off-by: Brian Haley <brian.haley@hp.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.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c index b6215be0963f..85b3d0036afd 100644 --- a/net/ipv6/af_inet6.c +++ b/net/ipv6/af_inet6.c | |||
@@ -72,9 +72,21 @@ MODULE_LICENSE("GPL"); | |||
72 | static struct list_head inetsw6[SOCK_MAX]; | 72 | static struct list_head inetsw6[SOCK_MAX]; |
73 | static DEFINE_SPINLOCK(inetsw6_lock); | 73 | static DEFINE_SPINLOCK(inetsw6_lock); |
74 | 74 | ||
75 | static int disable_ipv6 = 0; | 75 | struct ipv6_params ipv6_defaults = { |
76 | module_param_named(disable, disable_ipv6, int, 0); | 76 | .disable_ipv6 = 0, |
77 | MODULE_PARM_DESC(disable, "Disable IPv6 such that it is non-functional"); | 77 | .autoconf = 1, |
78 | }; | ||
79 | |||
80 | static int disable_ipv6_mod = 0; | ||
81 | |||
82 | module_param_named(disable, disable_ipv6_mod, int, 0444); | ||
83 | MODULE_PARM_DESC(disable, "Disable IPv6 module such that it is non-functional"); | ||
84 | |||
85 | module_param_named(disable_ipv6, ipv6_defaults.disable_ipv6, int, 0444); | ||
86 | MODULE_PARM_DESC(disable_ipv6, "Disable IPv6 on all interfaces"); | ||
87 | |||
88 | module_param_named(autoconf, ipv6_defaults.autoconf, int, 0444); | ||
89 | MODULE_PARM_DESC(autoconf, "Enable IPv6 address autoconfiguration on all interfaces"); | ||
78 | 90 | ||
79 | static __inline__ struct ipv6_pinfo *inet6_sk_generic(struct sock *sk) | 91 | static __inline__ struct ipv6_pinfo *inet6_sk_generic(struct sock *sk) |
80 | { | 92 | { |
@@ -1038,7 +1050,7 @@ static int __init inet6_init(void) | |||
1038 | for(r = &inetsw6[0]; r < &inetsw6[SOCK_MAX]; ++r) | 1050 | for(r = &inetsw6[0]; r < &inetsw6[SOCK_MAX]; ++r) |
1039 | INIT_LIST_HEAD(r); | 1051 | INIT_LIST_HEAD(r); |
1040 | 1052 | ||
1041 | if (disable_ipv6) { | 1053 | if (disable_ipv6_mod) { |
1042 | printk(KERN_INFO | 1054 | printk(KERN_INFO |
1043 | "IPv6: Loaded, but administratively disabled, " | 1055 | "IPv6: Loaded, but administratively disabled, " |
1044 | "reboot required to enable\n"); | 1056 | "reboot required to enable\n"); |
@@ -1227,7 +1239,7 @@ module_init(inet6_init); | |||
1227 | 1239 | ||
1228 | static void __exit inet6_exit(void) | 1240 | static void __exit inet6_exit(void) |
1229 | { | 1241 | { |
1230 | if (disable_ipv6) | 1242 | if (disable_ipv6_mod) |
1231 | return; | 1243 | return; |
1232 | 1244 | ||
1233 | /* First of all disallow new sockets creation. */ | 1245 | /* First of all disallow new sockets creation. */ |