From: Paul Gortmaker <paul.gortmaker@windriver.com>
To: David Miller <davem@davemloft.net>
Cc: <netdev@vger.kernel.org>, Jon Maloy <jon.maloy@ericsson.com>,
Ying Xue <ying.xue@windriver.com>,
Erik Hugne <erik.hugne@ericsson.com>,
Paul Gortmaker <paul.gortmaker@windriver.com>
Subject: [PATCH net-next 03/16] tipc: allow implicit connect for stream sockets
Date: Mon, 17 Jun 2013 10:54:38 -0400 [thread overview]
Message-ID: <1371480891-5264-4-git-send-email-paul.gortmaker@windriver.com> (raw)
In-Reply-To: <1371480891-5264-1-git-send-email-paul.gortmaker@windriver.com>
From: Erik Hugne <erik.hugne@ericsson.com>
TIPC's implied connect feature, aka piggyback connect, allows
applications to save one syscall and all SYN/SYN-ACK signalling
overhead when setting up a connection. Until now, this has only
been supported for SEQPACKET sockets. Here, we make it possible
to use this feature even with stream sockets.
At the connecting side, the connection is completed when the
first data message arrives from the accepting peer. This means
that we must allow the connecting user to call blocking recv()
before the socket has reached state SS_CONNECTED. So we must must
relax the state machine check at recv_stream(), and allow the
recv() call even if socket is in state SS_CONNECTING.
Signed-off-by: Erik Hugne <erik.hugne@ericsson.com>
Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
net/tipc/socket.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/net/tipc/socket.c b/net/tipc/socket.c
index aba4255..d5fa708f 100644
--- a/net/tipc/socket.c
+++ b/net/tipc/socket.c
@@ -518,8 +518,7 @@ static int send_msg(struct kiocb *iocb, struct socket *sock,
res = -EISCONN;
goto exit;
}
- if ((tport->published) ||
- ((sock->type == SOCK_STREAM) && (total_len != 0))) {
+ if (tport->published) {
res = -EOPNOTSUPP;
goto exit;
}
@@ -1010,8 +1009,7 @@ static int recv_stream(struct kiocb *iocb, struct socket *sock,
lock_sock(sk);
- if (unlikely((sock->state == SS_UNCONNECTED) ||
- (sock->state == SS_CONNECTING))) {
+ if (unlikely((sock->state == SS_UNCONNECTED))) {
res = -ENOTCONN;
goto exit;
}
--
1.8.1.2
next prev parent reply other threads:[~2013-06-17 14:55 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-17 14:54 [PATCH v2 net-next 00/16] tipc: make use of kernel threads to simplify things Paul Gortmaker
2013-06-17 14:54 ` [PATCH net-next 01/16] tipc: update code comments to reflect new uapi header path Paul Gortmaker
2013-06-17 17:33 ` Sergei Shtylyov
2013-06-17 14:54 ` [PATCH net-next 02/16] tipc: change socket buffer overflow control to respect sk_rcvbuf Paul Gortmaker
2013-06-17 23:55 ` Neil Horman
2013-06-17 14:54 ` Paul Gortmaker [this message]
2013-06-17 14:54 ` [PATCH net-next 04/16] tipc: introduce new TIPC server infrastructure Paul Gortmaker
2013-06-17 14:54 ` [PATCH net-next 05/16] tipc: convert topology server to use new server facility Paul Gortmaker
2013-06-17 14:54 ` [PATCH net-next 06/16] tipc: convert configuration " Paul Gortmaker
2013-06-17 14:54 ` [PATCH net-next 07/16] tipc: delete code orphaned by new server infrastructure Paul Gortmaker
2013-06-17 14:54 ` [PATCH net-next 08/16] tipc: remove user_port instance from tipc_port structure Paul Gortmaker
2013-06-17 14:54 ` [PATCH net-next 09/16] tipc: rename tipc_createport_raw to tipc_createport Paul Gortmaker
2013-06-17 14:54 ` [PATCH net-next 10/16] tipc: convert config_lock from spinlock to mutex Paul Gortmaker
2013-06-17 14:54 ` [PATCH net-next 11/16] tipc: save sock structure pointer instead of void pointer to tipc_port Paul Gortmaker
2013-06-17 14:54 ` [PATCH net-next 12/16] tipc: cosmetic realignment of function arguments Paul Gortmaker
2013-06-17 14:54 ` [PATCH net-next 13/16] tipc: enhance priority of link protocol packet Paul Gortmaker
2013-06-17 14:54 ` [PATCH net-next 14/16] tipc: make tipc_link_send_sections_fast exit earlier Paul Gortmaker
2013-06-17 14:54 ` [PATCH net-next 15/16] tipc: fix wrong return value for link_send_sections_long routine Paul Gortmaker
2013-06-17 14:54 ` [PATCH net-next 16/16] tipc: remove dev_base_lock use from enable_bearer Paul Gortmaker
2013-06-17 22:53 ` [PATCH v2 net-next 00/16] tipc: make use of kernel threads to simplify things David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1371480891-5264-4-git-send-email-paul.gortmaker@windriver.com \
--to=paul.gortmaker@windriver.com \
--cc=davem@davemloft.net \
--cc=erik.hugne@ericsson.com \
--cc=jon.maloy@ericsson.com \
--cc=netdev@vger.kernel.org \
--cc=ying.xue@windriver.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).