[IPV4]: Unify and cleanup calls to devinet_sysctl_register
authorPavel Emelyanov <xemul@openvz.org>
Sat, 1 Dec 2007 13:55:54 +0000 (00:55 +1100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 28 Jan 2008 22:55:36 +0000 (14:55 -0800)
commit66f27a52037c89183e83689b0531412577be0101
treea746d24ad70e9eb7d3aef9e4c798cd65db2cfe63
parentedae58ead57319b0bcf16e48a32365145c7bf0b7
[IPV4]: Unify and cleanup calls to devinet_sysctl_register

Currently this call is used to register sysctls for devices
and for the "default" confs. The "all" sysctls are registered
separately.

Besides, the inet_device is passed to this function, but it is
not needed there at all - just the device name and ifindex are
required.

Thanks to Herbert, who noticed, that this call doesn't even
require the devconf pointer (the last argument) - all we need
we can take from the in_device itself.

The fix is to make a __devinet_sysctl_register(), which registers
sysctls for all "devices" we need, including "default" and "all" :)

The original devinet_sysctl_register() works with struct net_device,
not the inet_device, and calls the introduced function, passing
the device name and ifindex (to be used as procname and ctl_name)
into it.

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/ipv4/devinet.c