aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/socket.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@kernel.org>2014-05-23 15:55:12 -0400
committerDavid S. Miller <davem@davemloft.net>2014-05-24 14:11:41 -0400
commit85d3fc9418dc5b357290de89b99c9a8bdd9eef89 (patch)
tree2e4f7c47b56dc7ffdfe1e45fa3bd58c4c5d11580 /net/tipc/socket.c
parentMerge branch 'ks8851' (diff)
downloadlinux-dev-85d3fc9418dc5b357290de89b99c9a8bdd9eef89.tar.xz
linux-dev-85d3fc9418dc5b357290de89b99c9a8bdd9eef89.zip
tipc: Don't reset the timeout when restarting
As it may then take longer than what the user specified using setsockopt(SO_RCVTIMEO). Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Jon Maloy <jon.maloy@ericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/socket.c')
-rw-r--r--net/tipc/socket.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/net/tipc/socket.c b/net/tipc/socket.c
index ac08966f2858..08d87fc80b10 100644
--- a/net/tipc/socket.c
+++ b/net/tipc/socket.c
@@ -985,10 +985,11 @@ static int anc_data_recv(struct msghdr *m, struct tipc_msg *msg,
return 0;
}
-static int tipc_wait_for_rcvmsg(struct socket *sock, long timeo)
+static int tipc_wait_for_rcvmsg(struct socket *sock, long *timeop)
{
struct sock *sk = sock->sk;
DEFINE_WAIT(wait);
+ long timeo = *timeop;
int err;
for (;;) {
@@ -1013,6 +1014,7 @@ static int tipc_wait_for_rcvmsg(struct socket *sock, long timeo)
break;
}
finish_wait(sk_sleep(sk), &wait);
+ *timeop = timeo;
return err;
}
@@ -1056,7 +1058,7 @@ static int tipc_recvmsg(struct kiocb *iocb, struct socket *sock,
restart:
/* Look for a message in receive queue; wait if necessary */
- res = tipc_wait_for_rcvmsg(sock, timeo);
+ res = tipc_wait_for_rcvmsg(sock, &timeo);
if (res)
goto exit;
@@ -1154,7 +1156,7 @@ static int tipc_recv_stream(struct kiocb *iocb, struct socket *sock,
restart:
/* Look for a message in receive queue; wait if necessary */
- res = tipc_wait_for_rcvmsg(sock, timeo);
+ res = tipc_wait_for_rcvmsg(sock, &timeo);
if (res)
goto exit;