• Ying Xue's avatar
    tipc: standardize accept routine · 6398e23c
    Ying Xue authored
    Comparing the behaviour of how to wait for events in TIPC accept()
    with other stacks, the TIPC implementation might be perceived as
    different, and sometimes even incorrect. As sk_sleep() and
    sk->sk_receive_queue variables associated with socket are not
    protected by socket lock, the process of calling accept() may be
    woken up improperly or sometimes cannot be woken up at all. After
    standardizing it with inet_csk_wait_for_connect routine, we can
    get benefits including: avoiding 'thundering herd' phenomenon,
    adding a timeout mechanism for accept(), coping with a pending
    signal, and having sk_sleep() and sk->sk_receive_queue being
    always protected within socket lock scope and so on.
    Signed-off-by: default avatarYing Xue <ying.xue@windriver.com>
    Reviewed-by: default avatarJon Maloy <jon.maloy@ericsson.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    6398e23c
socket.c 50 KB