From a9d09e93dbc4392d96db45cefb046c7140bc3ea3 Mon Sep 17 00:00:00 2001 From: Ian Dowse Date: Fri, 18 May 2001 19:43:18 +0000 Subject: [PATCH] The function clnt_dg_call(), which is used for UDP RPC calls, could accidentally clobber the server address if a stray packet arrived at the client port. This would result in any further retransmits going to the wrong address. For now, fix this by not saving the source address of the reply; this matches the pre-tirpc behaviour. --- lib/libc/rpc/clnt_dg.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/libc/rpc/clnt_dg.c b/lib/libc/rpc/clnt_dg.c index 089c79b9b48..2ab6f4a1299 100644 --- a/lib/libc/rpc/clnt_dg.c +++ b/lib/libc/rpc/clnt_dg.c @@ -310,7 +310,7 @@ clnt_dg_call(cl, proc, xargs, argsp, xresults, resultsp, utimeout) int dtbsize = __rpc_dtbsize(); sigset_t mask; sigset_t newmask; - socklen_t fromlen, inlen; + socklen_t inlen; ssize_t recvlen = 0; int rpc_lock_value; u_int32_t xid; @@ -492,10 +492,8 @@ get_reply: */ errno = 0; } - fromlen = sizeof (struct sockaddr_storage); recvlen = _recvfrom(cu->cu_fd, cu->cu_inbuf, - cu->cu_recvsz, 0, (struct sockaddr *)(void *)&cu->cu_raddr, - &fromlen); + cu->cu_recvsz, 0, NULL, NULL); } while (recvlen < 0 && errno == EINTR); if (recvlen < 0) { if (errno == EWOULDBLOCK)