From 33e6f9c10c4f0c3f47dafe8a22350971dc5fecfd Mon Sep 17 00:00:00 2001 From: "Simon L. B. Nielsen" Date: Tue, 24 Jul 2007 13:06:08 +0000 Subject: [PATCH] Set timeout for all NIS RPC requests to 1 second and not just for yp_next as revision 1.50 did. This should fix, or at least very much reduce the risk of, NIS timing out due to UDP packet loss for NIS functions. See also revision 1.50 for more details about the general problem. Tested by: nosedive, freefall, hub, mx1, brooks MFC after: 1 week Approved by: re (mux) --- lib/libc/yp/yplib.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/libc/yp/yplib.c b/lib/libc/yp/yplib.c index cc0a511ecd3..eb5c34c1670 100644 --- a/lib/libc/yp/yplib.c +++ b/lib/libc/yp/yplib.c @@ -555,6 +555,14 @@ gotit: _ypbindlist = ysd; } + /* + * Set low retry timeout to realistically handle UDP packet + * loss for YP packet bursts. + */ + tv.tv_sec = 1; + tv.tv_usec = 0; + clnt_control(ysd->dom_client, CLSET_RETRY_TIMEOUT, (char*)&tv); + if (ypdb != NULL) *ypdb = ysd; return (0); @@ -823,14 +831,6 @@ again: return (YPERR_DOMAIN); } - /* - * Set low retry timeout to realistically handle UDP packet - * loss for yp_next packet bursts. - */ - tv.tv_sec = 1; - tv.tv_usec = 0; - clnt_control(ysd->dom_client, CLSET_RETRY_TIMEOUT, (char*)&tv); - tv.tv_sec = _yplib_timeout; tv.tv_usec = 0;