• Kuniyuki Iwashima's avatar
    af_unix: Cut unix_validate_addr() out of unix_mkname(). · b8a58aa6
    Kuniyuki Iwashima authored
    unix_mkname() tests socket address length and family and does some
    processing based on the address type.  It is called in the early stage,
    and therefore some instructions are redundant and can end up in vain.
    
    The address length/family tests are done twice in unix_bind().  Also, the
    address type is rechecked later in unix_bind() and unix_find_other(), where
    we can do the same processing.  Moreover, in the BSD address case, the hash
    is set to 0 but never used and confusing.
    
    This patch moves the address tests out of unix_mkname(), and the following
    patches move the other part into appropriate places and remove
    unix_mkname() finally.
    Signed-off-by: default avatarKuniyuki Iwashima <kuniyu@amazon.co.jp>
    Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
    b8a58aa6
af_unix.c 80.8 KB