net ipv6: Fix duplicate /proc/sys/net/ipv6/neigh directory entries.
authorEric W. Biederman <ebiederm@aristanetworks.com>
Tue, 22 Mar 2011 01:23:34 +0000 (18:23 -0700)
committerBrad Figg <brad.figg@canonical.com>
Wed, 27 Apr 2011 18:41:56 +0000 (11:41 -0700)
commit84b7b0e718e549965b103900703b838439de1ae5
tree615b0e11911601e453db28f9674e96c11e94a288
parent0f00f3de4199a1f447929236e9d46a03c6d4bd64
net ipv6: Fix duplicate /proc/sys/net/ipv6/neigh directory entries.

BugLink: http://bugs.launchpad.net/bugs/769042

[ Upstream commit 9d2a8fa96a44ba242de3a6f56acaef7a40a97b97 ]

When I was fixing issues with unregisgtering tables under /proc/sys/net/ipv6/neigh
by adding a mount point it appears I missed a critical ordering issue, in the
ipv6 initialization.  I had not realized that ipv6_sysctl_register is called
at the very end of the ipv6 initialization and in particular after we call
neigh_sysctl_register from ndisc_init.

"neigh" needs to be initialized in ipv6_static_sysctl_register which is
the first ipv6 table to initialized, and definitely before ndisc_init.
This removes the weirdness of duplicate tables while still providing a
"neigh" mount point which prevents races in sysctl unregistering.

This was initially reported at https://bugzilla.kernel.org/show_bug.cgi?id=31232
Reported-by: sunkan@zappa.cx
Signed-off-by: Eric W. Biederman <ebiederm@aristanetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

Signed-off-by: Leann Ogasawara <leann.ogasawara@canonical.com>
net/ipv6/sysctl_net_ipv6.c