]> git.baikalelectronics.ru Git - kernel.git/commit
[NEIGH]: Use the ctl paths to create neighbours sysctls
authorPavel Emelyanov <xemul@openvz.org>
Sat, 1 Dec 2007 13:08:16 +0000 (00:08 +1100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 28 Jan 2008 22:55:24 +0000 (14:55 -0800)
commitb4c8e0d05679e1872bdc88598929f467d53b118d
tree449fac046faf749a6c24e5edc9c03c2441e853b3
parentcf09554ee59425386f73f9af1b34f844e741df65
[NEIGH]: Use the ctl paths to create neighbours sysctls

The appropriate path is prepared right inside this function. It
is prepared similar to how the ctl tables were.

Since the path is modified, it is put on the stack, to avoid
possible races with multiple calls to neigh_sysctl_register() : it
is called by protocols and I didn't find any protection in this
case. Did I overlooked the rtnl lock?.

The stack growth of the neigh_sysctl_register() is 40 bytes. I
believe this is OK, since this is not that much and this function
is not called with the deep stack (device/protocols register).

The device's name is stored on the template to free it later.

This will help with the net namespaces, as each namespace should
have its own set of these ctls.

Besides, this saves ~350 bytes from the neigh template :)

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/neighbour.c