Skip to content
  • Pavel Emelyanov's avatar
    [NEIGH]: Use the ctl paths to create neighbours sysctls · c3bac5a7
    Pavel Emelyanov authored
    
    
    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: 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>
    c3bac5a7