change the timeout struct timeval. Under Linux, this reflects the
time left available - which might result in 0 in the case of a
timeout. When attempting to resend a request, this may results in
a timeout of zero - flooding the server with replay requests.
* clnt_tcp.c (readtcp): Same.
* pmap_rmt.c (clnt_broadcast): Same
* svc_tcp.c (readtcp): Same
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13679
dc483132-0cff-0310-8789-
dd5450dbe970
+2001-08-10 <epeisach@mit.edu>
+
+ * clnt_udp.c (clntudp_call): Do not assume that select will not
+ change the timeout struct timeval. Under Linux, this reflects the
+ time left available - which might result in 0 in the case of a
+ timeout. When attempting to resend a request, this may results in
+ a timeout of zero - flooding the server with replay requests.
+
+ * clnt_tcp.c (readtcp): Same.
+ * pmap_rmt.c (clnt_broadcast): Same
+ * svc_tcp.c (readtcp): Same
+
2001-07-26 Ezra Peisach <epeisach@home>
* xdr_reference.c (xdr_reference): Remove cast in argument to memset.
register int len;
{
register struct ct_data *ct = (struct ct_data *)(void *)ctptr;
+ struct timeval tout;
#ifdef FD_SETSIZE
fd_set mask;
fd_set readfds;
#endif /* def FD_SETSIZE */
while (TRUE) {
readfds = mask;
+ tout = ct->ct_wait;
switch (select(_gssrpc_rpc_dtablesize(), &readfds, (fd_set*)NULL, (fd_set*)NULL,
- &(ct->ct_wait))) {
+ &tout)) {
case 0:
ct->ct_error.re_status = RPC_TIMEDOUT;
return (-1);
struct sockaddr_in from;
struct rpc_msg reply_msg;
XDR reply_xdrs;
- struct timeval time_waited;
+ struct timeval time_waited, seltimeout;
bool_t ok;
int nrefreshes = 2; /* number of times to refresh cred */
struct timeval timeout;
#endif /* def FD_SETSIZE */
for (;;) {
readfds = mask;
+ seltimeout = cu->cu_wait;
switch (select(_gssrpc_rpc_dtablesize(), &readfds, (fd_set *)NULL,
- (fd_set *)NULL, &(cu->cu_wait))) {
+ (fd_set *)NULL, &seltimeout)) {
case 0:
time_waited.tv_sec += cu->cu_wait.tv_sec;
struct rmtcallargs a;
struct rmtcallres r;
struct rpc_msg msg;
- struct timeval t;
+ struct timeval t, t2;
char outbuf[MAX_BROADCAST_SIZE];
#ifndef MAX
#define MAX(A,B) ((A)<(B)?(B):(A))
msg.acpted_rply.ar_results.where = (caddr_t)&r;
msg.acpted_rply.ar_results.proc = xdr_rmtcallres;
readfds = mask;
+ t2 = t;
switch (select(_gssrpc_rpc_dtablesize(), &readfds, (fd_set *)NULL,
- (fd_set *)NULL, &t)) {
+ (fd_set *)NULL, &t2)) {
case 0: /* timed out */
stat = RPC_TIMEDOUT;
{
register SVCXPRT *xprt = (SVCXPRT *)(void *)xprtptr;
register int sock = xprt->xp_sock;
+ struct timeval tout;
#ifdef FD_SETSIZE
fd_set mask;
fd_set readfds;
#endif /* def FD_SETSIZE */
do {
readfds = mask;
+ tout = wait_per_try;
if (select(_gssrpc_rpc_dtablesize(), &readfds, (fd_set*)NULL,
- (fd_set*)NULL, &wait_per_try) <= 0) {
+ (fd_set*)NULL, &tout) <= 0) {
if (errno == EINTR) {
continue;
}