• Kuniyuki Iwashima's avatar
    af_unix: Remove UNIX_ABSTRACT() macro and test sun_path[0] instead. · 5ce7ab49
    Kuniyuki Iwashima authored
    In BSD and abstract address cases, we store sockets in the hash table with
    keys between 0 and UNIX_HASH_SIZE - 1.  However, the hash saved in a socket
    varies depending on its address type; sockets with BSD addresses always
    have UNIX_HASH_SIZE in their unix_sk(sk)->addr->hash.
    
    This is just for the UNIX_ABSTRACT() macro used to check the address type.
    The difference of the saved hashes comes from the first byte of the address
    in the first place.  So, we can test it directly.
    
    Then we can keep a real hash in each socket and replace unix_table_lock
    with per-hash locks in the later patch.
    Signed-off-by: default avatarKuniyuki Iwashima <kuniyu@amazon.co.jp>
    Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
    5ce7ab49
bpf_iter_unix.c 2 KB