• Paolo Abeni's avatar
    mptcp: fix unblocking connect() · 41be81a8
    Paolo Abeni authored
    Currently unblocking connect() on MPTCP sockets fails frequently.
    If mptcp_stream_connect() is invoked to complete a previously
    attempted unblocking connection, it will still try to create
    the first subflow via __mptcp_socket_create(). If the 3whs is
    completed and the 'can_ack' flag is already set, the latter
    will fail with -EINVAL.
    
    This change addresses the issue checking for pending connect and
    delegating the completion to the first subflow. Additionally
    do msk addresses and sk_state changes only when needed.
    
    Fixes: 2303f994 ("mptcp: Associate MPTCP context with TCP socket")
    Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
    Reviewed-by: default avatarMat Martineau <mathew.j.martineau@linux.intel.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    41be81a8
protocol.c 48.4 KB