• Jozsef Kadlecsik's avatar
    netfilter: ipset: hash:ip set type support · 6c027889
    Jozsef Kadlecsik authored
    The module implements the hash:ip type support in four flavours:
    for IPv4 or IPv6, both without and with timeout support.
    
    All the hash types are based on the "array hash" or ahash structure
    and functions as a good compromise between minimal memory footprint
    and speed. The hashing uses arrays to resolve clashes. The hash table
    is resized (doubled) when searching becomes too long. Resizing can be
    triggered by userspace add commands only and those are serialized by
    the nfnl mutex. During resizing the set is read-locked, so the only
    possible concurrent operations are the kernel side readers. Those are
    protected by RCU locking.
    
    Because of the four flavours and the other hash types, the functions
    are implemented in general forms in the ip_set_ahash.h header file
    and the real functions are generated before compiling by macro expansion.
    Thus the dereferencing of low-level functions and void pointer arguments
    could be avoided: the low-level functions are inlined, the function
    arguments are pointers of type-specific structures.
    Signed-off-by: default avatarJozsef Kadlecsik <kadlec@blackhole.kfki.hu>
    Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
    6c027889
ip_set_hash_ip.c 11 KB