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.
This commit is contained in:
Ian Dowse 2001-05-18 19:43:18 +00:00
parent 4ba4d3873a
commit a9d09e93db
1 changed files with 2 additions and 4 deletions

View File

@ -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)