* sysctls below net.ipv[46].conf.all not working as expected @ 2010-12-29 16:06 Uwe Kleine-König 2010-12-30 20:20 ` Uwe Kleine-König 2010-12-30 20:30 ` David Miller 0 siblings, 2 replies; 5+ messages in thread From: Uwe Kleine-König @ 2010-12-29 16:06 UTC (permalink / raw) To: netdev Hello, I did the following: cassiopeia:~# sysctl net.ipv6.conf.all.use_tempaddr net.ipv6.conf.all.use_tempaddr = 0 cassiopeia:~# sysctl net.ipv6.conf.eth0.use_tempaddr net.ipv6.conf.eth0.use_tempaddr = 0 cassiopeia:~# sysctl -w net.ipv6.conf.all.use_tempaddr=1 net.ipv6.conf.all.use_tempaddr = 1 cassiopeia:~# sysctl net.ipv6.conf.all.use_tempaddr net.ipv6.conf.all.use_tempaddr = 1 cassiopeia:~# sysctl net.ipv6.conf.eth0.use_tempaddr net.ipv6.conf.eth0.use_tempaddr = 0 Here I would have expected that eth0's use_tempaddr is 1, too. The problem is not that this entry isn't writeable: cassiopeia:~# sysctl -w net.ipv6.conf.eth0.use_tempaddr=1 net.ipv6.conf.eth0.use_tempaddr = 1 cassiopeia:~# sysctl net.ipv6.conf.eth0.use_tempaddr net.ipv6.conf.eth0.use_tempaddr = 1 I got the same results when using net.ipv4.conf.all.rp_filter (and net.ipv4.conf.eth0.rp_filter resp.) Is this a bug or just my failure to see how conf/all works? Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-König | Industrial Linux Solutions | http://www.pengutronix.de/ | ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: sysctls below net.ipv[46].conf.all not working as expected 2010-12-29 16:06 sysctls below net.ipv[46].conf.all not working as expected Uwe Kleine-König @ 2010-12-30 20:20 ` Uwe Kleine-König 2010-12-30 20:30 ` David Miller 1 sibling, 0 replies; 5+ messages in thread From: Uwe Kleine-König @ 2010-12-30 20:20 UTC (permalink / raw) To: netdev; +Cc: Marco d'Itri Hello again, On Wed, Dec 29, 2010 at 05:06:07PM +0100, Uwe Kleine-König wrote: > I did the following: > > cassiopeia:~# sysctl net.ipv6.conf.all.use_tempaddr > net.ipv6.conf.all.use_tempaddr = 0 > > cassiopeia:~# sysctl net.ipv6.conf.eth0.use_tempaddr > net.ipv6.conf.eth0.use_tempaddr = 0 > > cassiopeia:~# sysctl -w net.ipv6.conf.all.use_tempaddr=1 > net.ipv6.conf.all.use_tempaddr = 1 > > cassiopeia:~# sysctl net.ipv6.conf.all.use_tempaddr > net.ipv6.conf.all.use_tempaddr = 1 > > cassiopeia:~# sysctl net.ipv6.conf.eth0.use_tempaddr > net.ipv6.conf.eth0.use_tempaddr = 0 > > Here I would have expected that eth0's use_tempaddr is 1, too. The > problem is not that this entry isn't writeable: > > cassiopeia:~# sysctl -w net.ipv6.conf.eth0.use_tempaddr=1 > net.ipv6.conf.eth0.use_tempaddr = 1 > > cassiopeia:~# sysctl net.ipv6.conf.eth0.use_tempaddr > net.ipv6.conf.eth0.use_tempaddr = 1 > > I got the same results when using net.ipv4.conf.all.rp_filter (and > net.ipv4.conf.eth0.rp_filter resp.) > > Is this a bug or just my failure to see how conf/all works? I put the following in my /etc/sysctl.conf: net.ipv6.conf.default.use_tempaddr = 1 net.ipv6.conf.all.use_tempaddr = 1 net.ipv6.conf.eth0.use_tempaddr = 1 and after a reboot eth0 got a temporary dynamic address, eth1 did not. So it doesn't seem to be as guessed by someone on #debian-kernel that the setting works but isn't propagated back to the sysctl of the interface. This makes me wonder how useful the lines net.ipv4.conf.default.rp_filter = 1 net.ipv4.conf.all.rp_filter = 1 (suggested by the Debian package netbase) are. Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-König | Industrial Linux Solutions | http://www.pengutronix.de/ | ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: sysctls below net.ipv[46].conf.all not working as expected 2010-12-29 16:06 sysctls below net.ipv[46].conf.all not working as expected Uwe Kleine-König 2010-12-30 20:20 ` Uwe Kleine-König @ 2010-12-30 20:30 ` David Miller 2010-12-30 20:43 ` Uwe Kleine-König 1 sibling, 1 reply; 5+ messages in thread From: David Miller @ 2010-12-30 20:30 UTC (permalink / raw) To: u.kleine-koenig; +Cc: netdev From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Date: Wed, 29 Dec 2010 17:06:07 +0100 > I did the following: > > cassiopeia:~# sysctl net.ipv6.conf.all.use_tempaddr > net.ipv6.conf.all.use_tempaddr = 0 > > cassiopeia:~# sysctl net.ipv6.conf.eth0.use_tempaddr > net.ipv6.conf.eth0.use_tempaddr = 0 > > cassiopeia:~# sysctl -w net.ipv6.conf.all.use_tempaddr=1 > net.ipv6.conf.all.use_tempaddr = 1 > > cassiopeia:~# sysctl net.ipv6.conf.all.use_tempaddr > net.ipv6.conf.all.use_tempaddr = 1 > > cassiopeia:~# sysctl net.ipv6.conf.eth0.use_tempaddr > net.ipv6.conf.eth0.use_tempaddr = 0 > > Here I would have expected that eth0's use_tempaddr is 1, too. The > problem is not that this entry isn't writeable: The "all" value is propagated at the first moment that the ipv6 device private is created, usually that is when the device is first brought up which means it can happen as early as the exact moment the device is registered. Therefore, if you want "all" to apply to "eth0", you must make sure the sysctl is set properly before the device is registered. ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: sysctls below net.ipv[46].conf.all not working as expected 2010-12-30 20:30 ` David Miller @ 2010-12-30 20:43 ` Uwe Kleine-König 2011-02-22 9:34 ` Uwe Kleine-König 0 siblings, 1 reply; 5+ messages in thread From: Uwe Kleine-König @ 2010-12-30 20:43 UTC (permalink / raw) To: David Miller; +Cc: netdev Hello David, On Thu, Dec 30, 2010 at 12:30:23PM -0800, David Miller wrote: > From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> > Date: Wed, 29 Dec 2010 17:06:07 +0100 > > > I did the following: > > > > cassiopeia:~# sysctl net.ipv6.conf.all.use_tempaddr > > net.ipv6.conf.all.use_tempaddr = 0 > > > > cassiopeia:~# sysctl net.ipv6.conf.eth0.use_tempaddr > > net.ipv6.conf.eth0.use_tempaddr = 0 > > > > cassiopeia:~# sysctl -w net.ipv6.conf.all.use_tempaddr=1 > > net.ipv6.conf.all.use_tempaddr = 1 > > > > cassiopeia:~# sysctl net.ipv6.conf.all.use_tempaddr > > net.ipv6.conf.all.use_tempaddr = 1 > > > > cassiopeia:~# sysctl net.ipv6.conf.eth0.use_tempaddr > > net.ipv6.conf.eth0.use_tempaddr = 0 > > > > Here I would have expected that eth0's use_tempaddr is 1, too. The > > problem is not that this entry isn't writeable: > > The "all" value is propagated at the first moment that the ipv6 device > private is created, usually that is when the device is first brought up > which means it can happen as early as the exact moment the device is > registered. > > Therefore, if you want "all" to apply to "eth0", you must make sure > the sysctl is set properly before the device is registered. I thought this is what "default" was used for?! If you are really right, the documentation is (IMHO) misleading. e.g. Documentation/networking/ip-sysctl.txt tells: conf/default/*: Change the interface-specific default settings. conf/all/*: Change all the interface-specific settings. Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-König | Industrial Linux Solutions | http://www.pengutronix.de/ | ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: sysctls below net.ipv[46].conf.all not working as expected 2010-12-30 20:43 ` Uwe Kleine-König @ 2011-02-22 9:34 ` Uwe Kleine-König 0 siblings, 0 replies; 5+ messages in thread From: Uwe Kleine-König @ 2011-02-22 9:34 UTC (permalink / raw) To: David Miller; +Cc: netdev, Marco d'Itri Hello David, On Thu, Dec 30, 2010 at 09:43:19PM +0100, Uwe Kleine-König wrote: > On Thu, Dec 30, 2010 at 12:30:23PM -0800, David Miller wrote: > > From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> > > Date: Wed, 29 Dec 2010 17:06:07 +0100 > > > > > I did the following: > > > > > > cassiopeia:~# sysctl net.ipv6.conf.all.use_tempaddr > > > net.ipv6.conf.all.use_tempaddr = 0 > > > > > > cassiopeia:~# sysctl net.ipv6.conf.eth0.use_tempaddr > > > net.ipv6.conf.eth0.use_tempaddr = 0 > > > > > > cassiopeia:~# sysctl -w net.ipv6.conf.all.use_tempaddr=1 > > > net.ipv6.conf.all.use_tempaddr = 1 > > > > > > cassiopeia:~# sysctl net.ipv6.conf.all.use_tempaddr > > > net.ipv6.conf.all.use_tempaddr = 1 > > > > > > cassiopeia:~# sysctl net.ipv6.conf.eth0.use_tempaddr > > > net.ipv6.conf.eth0.use_tempaddr = 0 > > > > > > Here I would have expected that eth0's use_tempaddr is 1, too. The > > > problem is not that this entry isn't writeable: > > > > The "all" value is propagated at the first moment that the ipv6 device > > private is created, usually that is when the device is first brought up > > which means it can happen as early as the exact moment the device is > > registered. > > > > Therefore, if you want "all" to apply to "eth0", you must make sure > > the sysctl is set properly before the device is registered. > I thought this is what "default" was used for?! I took the time now to dig into the source for ipv4/{all,default}. Unless I'm mistaken I found: - inetdev_init copies dev_net(dev)->ipv4.devconf_dflt to &in_dev->cnf That's called from inetdev_event if there is no in_dev. - devinet_copy_dflt_conf copies to all devices that have !test_bit(i, in_dev->cnf.state) devinet_copy_dflt_conf is called when /proc/sys/net/ipv4/conf/default is written to. I didn't found where the in_dev->cnf.state bits are set. - net->ipv4.devconf_all is never propagated to the devices. - The data behind /proc/sys/net/ipv4/conf/all is used in registering net->ipv4.forw_hdr and seems only have to do with ip_forward So I think that it's really "default" that propagates to a new device as I expected and the documentation suggests. So IMHO a better name for "all" would be "global" ... > If you are really right, the documentation is (IMHO) misleading. e.g. > Documentation/networking/ip-sysctl.txt tells: > > conf/default/*: > Change the interface-specific default settings. > > conf/all/*: > Change all the interface-specific settings. ... and this is misleading. I wonder if it would be considered OK, to create a new config directory called "global" that acts like "all" now and let "all" propagate all changes to all devices, "default" and "global". If not the documentation needs clearification. I guess for ipv6 it's similar, though I didn't check that. Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-König | Industrial Linux Solutions | http://www.pengutronix.de/ | ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-02-22 10:41 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2010-12-29 16:06 sysctls below net.ipv[46].conf.all not working as expected Uwe Kleine-König 2010-12-30 20:20 ` Uwe Kleine-König 2010-12-30 20:30 ` David Miller 2010-12-30 20:43 ` Uwe Kleine-König 2011-02-22 9:34 ` Uwe Kleine-König
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).