From: Paul Stewart <hidden> Date: 2011-09-01 06:27:56
When ipv6 is used as a module, there is no good place to set
the default value for use_tempaddr. Using sysctl.conf will
set this parameter too early -- before the module is loaded.
To solve this, create a module parameter that will set the
default value of use_tempaddr for all devices.
Signed-off-by: Paul Stewart <redacted>
---
include/linux/ipv6.h | 1 +
net/ipv6/addrconf.c | 3 +++
net/ipv6/af_inet6.c | 8 ++++++++
3 files changed, 12 insertions(+), 0 deletions(-)
@@ -4609,6 +4609,9 @@ static int __net_init addrconf_init_net(struct net *net)/* these will be inherited by all namespaces */dflt->autoconf=ipv6_defaults.autoconf;dflt->disable_ipv6=ipv6_defaults.disable_ipv6;+#ifdef CONFIG_IPV6_PRIVACY+dflt->use_tempaddr=ipv6_defaults.use_tempaddr;+#endif}net->ipv6.devconf_all=all;
@@ -89,6 +92,11 @@ MODULE_PARM_DESC(disable_ipv6, "Disable IPv6 on all interfaces");module_param_named(autoconf,ipv6_defaults.autoconf,int,0444);MODULE_PARM_DESC(autoconf,"Enable IPv6 address autoconfiguration on all interfaces");+#ifdef CONFIG_IPV6_PRIVACY+module_param_named(use_tempaddr,ipv6_defaults.use_tempaddr,int,0444);+MODULE_PARM_DESC(use_tempaddr,"Enable IPv6 address privacy for autoconfiguration by default");+#endif+static__inline__structipv6_pinfo*inet6_sk_generic(structsock*sk){constintoffset=sk->sk_prot->obj_size-sizeof(structipv6_pinfo);
From: Paul Stewart <hidden> Date: 2011-09-06 23:56:39
On Wed, Aug 31, 2011 at 11:03 PM, Paul Stewart [off-list ref] wrote:
quoted hunk
When ipv6 is used as a module, there is no good place to set
the default value for use_tempaddr. Using sysctl.conf will
set this parameter too early -- before the module is loaded.
To solve this, create a module parameter that will set the
default value of use_tempaddr for all devices.
Signed-off-by: Paul Stewart <redacted>
---
include/linux/ipv6.h | 1 +
net/ipv6/addrconf.c | 3 +++
net/ipv6/af_inet6.c | 8 ++++++++
3 files changed, 12 insertions(+), 0 deletions(-)
From: Paul Stewart <hidden> Date: 2011-09-12 16:37:17
Hello, folks. I've been trying to upstream (or open a discussion on)
adding a module parameter to enable IPv6 address privacy as a module
parameter. The author listed for if_inet6.c is not a bouncing email
address. Does anyone else have a suggestion for where to get this
change vetted? I'm now CC'ing the author and reviewer of the last
module parameter change for ipv6.
--
Paul
On Tue, Sep 6, 2011 at 4:56 PM, Paul Stewart [off-list ref] wrote:
On Wed, Aug 31, 2011 at 11:03 PM, Paul Stewart [off-list ref] wrote:
quoted
When ipv6 is used as a module, there is no good place to set
the default value for use_tempaddr. Using sysctl.conf will
set this parameter too early -- before the module is loaded.
To solve this, create a module parameter that will set the
default value of use_tempaddr for all devices.
Signed-off-by: Paul Stewart <redacted>
---
include/linux/ipv6.h | 1 +
net/ipv6/addrconf.c | 3 +++
net/ipv6/af_inet6.c | 8 ++++++++
3 files changed, 12 insertions(+), 0 deletions(-)
From: Brian Haley <hidden> Date: 2011-09-12 19:51:48
On 09/12/2011 12:37 PM, Paul Stewart wrote:
Hello, folks. I've been trying to upstream (or open a discussion on)
adding a module parameter to enable IPv6 address privacy as a module
parameter. The author listed for if_inet6.c is not a bouncing email
address. Does anyone else have a suggestion for where to get this
change vetted? I'm now CC'ing the author and reviewer of the last
module parameter change for ipv6.
@@ -89,6 +92,11 @@ MODULE_PARM_DESC(disable_ipv6, "Disable IPv6 on all interfaces"); module_param_named(autoconf, ipv6_defaults.autoconf, int, 0444); MODULE_PARM_DESC(autoconf, "Enable IPv6 address autoconfiguration on all interfaces");+#ifdef CONFIG_IPV6_PRIVACY+module_param_named(use_tempaddr, ipv6_defaults.use_tempaddr, int, 0444);+MODULE_PARM_DESC(use_tempaddr, "Enable IPv6 address privacy for autoconfiguration by default");+#endif
I don't know if you want this under an #ifdef, since that could fail a module
load on certain kernel builds - people might want to put the same entry in a
conf file whether the kernel supports it or not (if it's accepted).
And you failed to update Documentation/networking/ipv6.txt
-Brian
From: Paul Stewart <hidden> Date: 2011-09-12 21:20:22
When ipv6 is used as a module, there is no good place to set
the default value for use_tempaddr. Using sysctl.conf will
set this parameter too early -- before the module is loaded.
To solve this, create a module parameter that will set the
default value of use_tempaddr for all devices.
Signed-off-by: Paul Stewart <redacted>
Cc: davem@davemloft.net
Cc: brian.haley@hp.com
--
v2: Add documentation; move module parameter out of ifdef
---
Documentation/networking/ipv6.txt | 20 ++++++++++++++++++++
include/linux/ipv6.h | 1 +
net/ipv6/addrconf.c | 3 +++
net/ipv6/af_inet6.c | 4 ++++
4 files changed, 28 insertions(+), 0 deletions(-)
@@ -70,3 +70,23 @@ disable_ipv6 No IPv6 addresses will be added to interfaces.+use_tempaddr++ Specifies whether to enable Privacy Extensions for Stateless+ Address Autoconfiguration (RFC3041) on all interfaces by default.++ The possible values and their effects are:++ 0+ Privacy addresses are not enabled by default.++ This is the default value.++ 1+ Privacy addresses are enabled by default on all interfaces+ but do not prefer them over normal addresses.++ 2+ Privacy addresses are enabled by default on all interfaces+ and will be preferred over normal addresses.+
@@ -4609,6 +4609,9 @@ static int __net_init addrconf_init_net(struct net *net)/* these will be inherited by all namespaces */dflt->autoconf=ipv6_defaults.autoconf;dflt->disable_ipv6=ipv6_defaults.disable_ipv6;+#ifdef CONFIG_IPV6_PRIVACY+dflt->use_tempaddr=ipv6_defaults.use_tempaddr;+#endif}net->ipv6.devconf_all=all;
@@ -89,6 +90,9 @@ MODULE_PARM_DESC(disable_ipv6, "Disable IPv6 on all interfaces");module_param_named(autoconf,ipv6_defaults.autoconf,int,0444);MODULE_PARM_DESC(autoconf,"Enable IPv6 address autoconfiguration on all interfaces");+module_param_named(use_tempaddr,ipv6_defaults.use_tempaddr,int,0444);+MODULE_PARM_DESC(use_tempaddr,"Enable IPv6 address privacy for autoconfiguration by default");+static__inline__structipv6_pinfo*inet6_sk_generic(structsock*sk){constintoffset=sk->sk_prot->obj_size-sizeof(structipv6_pinfo);
From: Paul Stewart <hidden> Date: 2011-09-12 21:21:54
On Mon, Sep 12, 2011 at 12:51 PM, Brian Haley [off-list ref] wrote:
On 09/12/2011 12:37 PM, Paul Stewart wrote:
quoted
Hello, folks. I've been trying to upstream (or open a discussion on)
adding a module parameter to enable IPv6 address privacy as a module
parameter. The author listed for if_inet6.c is not a bouncing email
address. Does anyone else have a suggestion for where to get this
change vetted? I'm now CC'ing the author and reviewer of the last
module parameter change for ipv6.
Thanks Brian. At least I can guess now that I'm sending mail to the
right list. :-)
--
Paul
quoted
quoted
quoted
static int disable_ipv6_mod = 0;
@@ -89,6 +92,11 @@ MODULE_PARM_DESC(disable_ipv6, "Disable IPv6 on all interfaces");
module_param_named(autoconf, ipv6_defaults.autoconf, int, 0444);
MODULE_PARM_DESC(autoconf, "Enable IPv6 address autoconfiguration on all interfaces");
+#ifdef CONFIG_IPV6_PRIVACY
+module_param_named(use_tempaddr, ipv6_defaults.use_tempaddr, int, 0444);
+MODULE_PARM_DESC(use_tempaddr, "Enable IPv6 address privacy for autoconfiguration by default");
+#endif
I don't know if you want this under an #ifdef, since that could fail a module
load on certain kernel builds - people might want to put the same entry in a
conf file whether the kernel supports it or not (if it's accepted).
And you failed to update Documentation/networking/ipv6.txt
-Brian
When ipv6 is used as a module, there is no good place to set
the default value for use_tempaddr. Using sysctl.conf will
set this parameter too early -- before the module is loaded.
To solve this, create a module parameter that will set the
default value of use_tempaddr for all devices.
How is use_tempaddr any different from the other /proc/sys/net/ipv6/*
variables? Do you want to add a module parameter for all of them?
Why can't you run sysctl with an ipv6-specific sysctl.conf at a time
fitting your boot sequence? Or load the ipv6 module before sysctl is
loads the default sysctl.conf if that is what you want? Or just set the
variables in your network configuration scripts, prior to bringing the
interfaces up?
Or do as most people do nowadays: Forget that ipv6 can be built as a
module, and just use it builtin. It's not like it can be unloaded
anyway, so building it as a module does not give you anything.
Bjørn
From: Paul Stewart <hidden> Date: 2011-09-13 19:56:32
On Tue, Sep 13, 2011 at 11:39 AM, Bjørn Mork [off-list ref] wrote:
Paul Stewart [off-list ref] writes:
quoted
When ipv6 is used as a module, there is no good place to set
the default value for use_tempaddr. Using sysctl.conf will
set this parameter too early -- before the module is loaded.
To solve this, create a module parameter that will set the
default value of use_tempaddr for all devices.
How is use_tempaddr any different from the other /proc/sys/net/ipv6/*
variables? Do you want to add a module parameter for all of them?
With use_tempaddr and ipv6 loaded as a module, there is a gap of time
between addrconf starting up and whatever configuration one would use
to set use_tempaddr (you can't use sysctl.conf since module-load time
might be much later). By the time boot scripts (or whatever you'd
use) are able to tweak use_tempaddr, it might be too late and the
global-trackable address (related to the MAC address) might end up in
use. This negates the entire point of use_tempaddr. If any of the
other flags suffer this badly at module-load time, I'd be happy to add
module parameters for them, but this is the only one that I've come to
be aware of.
Why can't you run sysctl with an ipv6-specific sysctl.conf at a time
fitting your boot sequence? Or load the ipv6 module before sysctl is
loads the default sysctl.conf if that is what you want? Or just set the
variables in your network configuration scripts, prior to bringing the
interfaces up?
Or do as most people do nowadays: Forget that ipv6 can be built as a
module, and just use it builtin. It's not like it can be unloaded
anyway, so building it as a module does not give you anything.
All helpful suggestions. However, I'm not yet willing to accept the
claim that ipv6 cannot be used as a module unless the rest of the
system is painstakingly crafted to close any races between addrconf,
sysctl and other IPv6-using processes. That strikes me as far too
brittle.
--
Paul
From: David Miller <davem@davemloft.net> Date: 2011-09-13 20:05:31
From: Paul Stewart <redacted>
Date: Tue, 13 Sep 2011 12:56:28 -0700
However, I'm not yet willing to accept the claim that ipv6 cannot be
used as a module unless the rest of the system is painstakingly
crafted to close any races between addrconf, sysctl and other
IPv6-using processes. That strikes me as far too brittle.
Most distributions are moving to building ipv6 statically into the
kernel, largely because of the issues described here.