• K
    af_unix: Remove UNIX_ABSTRACT() macro and test sun_path[0] instead. · 5ce7ab49
    Kuniyuki Iwashima 提交于
    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: NKuniyuki Iwashima <kuniyu@amazon.co.jp>
    Signed-off-by: NJakub Kicinski <kuba@kernel.org>
    5ce7ab49
af_unix.c 80.8 KB