From f5b14fb4f37220a31a8d483cb507ac6e7d89d84d Mon Sep 17 00:00:00 2001 From: Chuck Lever Date: Mon, 29 Jun 2009 12:43:26 -0400 Subject: clnt_dg: Fix infinite loop when datagram call times out After an RPC over datagram call times out, clnt_dg_call() goes into a loop, spamming the server with endless retransmits. Since signals are masked, a ^C doesn't break the loop -- the process must be KILLed. Add missing logic to exit appropriately after the call's total time has expired. Signed-off-by: Chuck Lever Signed-off-by: Steve Dickson --- src/clnt_dg.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/clnt_dg.c b/src/clnt_dg.c index 2eeaada..2f870b1 100644 --- a/src/clnt_dg.c +++ b/src/clnt_dg.c @@ -381,6 +381,10 @@ call_again: } send_again: + if (total_time <= 0) { + cu->cu_error.re_status = RPC_TIMEDOUT; + goto out; + } nextsend_time = cu->cu_wait.tv_sec * 1000 + cu->cu_wait.tv_usec / 1000; if (sendto(cu->cu_fd, cu->cu_outbuf, outlen, 0, sa, salen) != outlen) { cu->cu_error.re_errno = errno; -- cgit v1.2.1