]> 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)
commit47ae4c8ad3f1ab447918d5e05f959fa07cf2b81d
tree35fec37c686069290b6abcb65d8815d46fa86483
parent48a553392375fc4936e1cf6472f1c4069893faa8
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