aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc
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
parent6c705d1362074f904394dbfbf2945c5180da4cc5 (diff)
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')
-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,
985 return 0; 985 return 0;
986} 986}
987 987
988static int tipc_wait_for_rcvmsg(struct socket *sock, long timeo) 988static int tipc_wait_for_rcvmsg(struct socket *sock, long *timeop)
989{ 989{
990 struct sock *sk = sock->sk; 990 struct sock *sk = sock->sk;
991 DEFINE_WAIT(wait); 991 DEFINE_WAIT(wait);
992 long timeo = *timeop;
992 int err; 993 int err;
993 994
994 for (;;) { 995 for (;;) {
@@ -1013,6 +1014,7 @@ static int tipc_wait_for_rcvmsg(struct socket *sock, long timeo)
1013 break; 1014 break;
1014 } 1015 }
1015 finish_wait(sk_sleep(sk), &wait); 1016 finish_wait(sk_sleep(sk), &wait);
1017 *timeop = timeo;
1016 return err; 1018 return err;
1017} 1019}
1018 1020
@@ -1056,7 +1058,7 @@ static int tipc_recvmsg(struct kiocb *iocb, struct socket *sock,
1056restart: 1058restart:
1057 1059
1058 /* Look for a message in receive queue; wait if necessary */ 1060 /* Look for a message in receive queue; wait if necessary */
1059 res = tipc_wait_for_rcvmsg(sock, timeo); 1061 res = tipc_wait_for_rcvmsg(sock, &timeo);
1060 if (res) 1062 if (res)
1061 goto exit; 1063 goto exit;
1062 1064
@@ -1154,7 +1156,7 @@ static int tipc_recv_stream(struct kiocb *iocb, struct socket *sock,
1154 1156
1155restart: 1157restart:
1156 /* Look for a message in receive queue; wait if necessary */ 1158 /* Look for a message in receive queue; wait if necessary */
1157 res = tipc_wait_for_rcvmsg(sock, timeo); 1159 res = tipc_wait_for_rcvmsg(sock, &timeo);
1158 if (res) 1160 if (res)
1159 goto exit; 1161 goto exit;
1160 1162