• Xin Long's avatar
    tipc: fix implicit-connect for SYN+ · f8dd60de
    Xin Long authored
    For implicit-connect, when it's either SYN- or SYN+, an ACK should
    be sent back to the client immediately. It's not appropriate for
    the client to enter established state only after receiving data
    from the server.
    
    On client side, after the SYN is sent out, tipc_wait_for_connect()
    should be called to wait for the ACK if timeout is set.
    
    This patch also restricts __tipc_sendstream() to call __sendmsg()
    only when it's in TIPC_OPEN state, so that the client can program
    in a single loop doing both connecting and data sending like:
    
      for (...)
          sendmsg(dest, buf);
    
    This makes the implicit-connect more implicit.
    
    Fixes: b97bf3fd ("[TIPC] Initial merge")
    Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
    Acked-by: default avatarJon Maloy <jmaloy@redhat.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    f8dd60de
socket.c 104 KB