• Pavel Emelyanov's avatar
    [IPV4]: Unify and cleanup calls to devinet_sysctl_register · 66f27a52
    Pavel Emelyanov authored
    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: default avatarPavel Emelyanov <xemul@openvz.org>
    Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    66f27a52
devinet.c 37.3 KB