]> git.baikalelectronics.ru Git - kernel.git/commit
tipc: fix implicit-connect for SYN+
authorXin Long <lucien.xin@gmail.com>
Thu, 22 Jul 2021 16:05:41 +0000 (12:05 -0400)
committerDavid S. Miller <davem@davemloft.net>
Fri, 23 Jul 2021 15:33:54 +0000 (16:33 +0100)
commit2db42de0f652881b89d635729ff07f8eba7252a6
tree35fec37c686069290b6abcb65d8815d46fa86483
parent3c40c95d6945dfd8b7f3ce883247c734c2926b84
tipc: fix implicit-connect for SYN+

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: 082dc377e86b ("[TIPC] Initial merge")
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Acked-by: Jon Maloy <jmaloy@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tipc/socket.c