NetBSD Problem Report #3117
Received: (qmail-queue invoked from smtpd); 17 Jan 1997 11:08:57 -0000
Message-Id: <199701171105.MAA13657@abro.ericsson.se>
Date: Fri, 17 Jan 1997 12:05:02 +0100 (MET)
From: Michael.Eriksson@era-t.ericsson.se
Reply-To: Michael.Eriksson@era-t.ericsson.se
To: gnats-bugs@gnats.netbsd.org
Cc: eramer@era-t.ericsson.se
Subject: YP doesn't let RPC do any retransmissions
X-Send-Pr-Version: 3.95
>Number: 3117
>Category: lib
>Synopsis: YP doesn't let RPC do any retransmissions
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: thorpej
>State: closed
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Fri Jan 17 03:20:00 +0000 1997
>Closed-Date: Tue Jan 21 20:36:45 +0000 1997
>Last-Modified: Tue Jan 21 20:41:42 +0000 1997
>Originator: Michael Eriksson
>Release: 1.2
>Organization:
Ericsson Radio Systems AB
>Environment:
NetBSD 1.2 (and -current)
>Description:
YP sets the resend interval to the same value as the total RPC
timeout, which means that it won't let RPC do any retries before doing
a rebind. In NetBSD 1.1 the retry interval was half the total timeout,
i.e., RPC was allowed to do one retransmission. This is desirable, as
the most common reason for a time out (at least on the network where
my machine is :-)) is a dropped packet, not a crashed/overloaded YP
server.
>How-To-Repeat:
Code inspection? Also note the need for the recent _yplib_nerrs change
in YP.
>Fix:
This patch is for 1.2 as released (as that is what I run). I've set
RPC_RETRIES to 4, which is nice for our lossy network, but might be
too demanding for other environments.
*** yplib.c.orig Sun May 26 08:13:58 1996
--- yplib.c Fri Jan 17 10:22:48 1997
***************
*** 56,62 ****
struct dom_binding *_ypbindlist;
char _yp_domain[MAXHOSTNAMELEN];
! struct timeval _yplib_timeout = { 10, 0 };
void _yp_unbind __P((struct dom_binding *));
--- 56,64 ----
struct dom_binding *_ypbindlist;
char _yp_domain[MAXHOSTNAMELEN];
! #define RPC_TIMEOUT 10
! #define RPC_RETRIES 4
! struct timeval _yplib_timeout = { RPC_TIMEOUT, 0 };
void _yp_unbind __P((struct dom_binding *));
***************
*** 74,79 ****
--- 76,82 ----
CLIENT *client;
int new = 0, r;
int count = 0;
+ struct timeval tv;
if (dom == NULL || *dom == 0)
return YPERR_BADARGS;
***************
*** 219,227 ****
if (ysd->dom_client)
clnt_destroy(ysd->dom_client);
ysd->dom_socket = RPC_ANYSOCK;
ysd->dom_client = clntudp_create(&ysd->dom_server_addr,
! YPPROG, YPVERS, _yplib_timeout,
! &ysd->dom_socket);
if (ysd->dom_client == NULL) {
clnt_pcreateerror("clntudp_create");
ysd->dom_vers = -1;
--- 222,231 ----
if (ysd->dom_client)
clnt_destroy(ysd->dom_client);
ysd->dom_socket = RPC_ANYSOCK;
+ tv.tv_sec = RPC_TIMEOUT / RPC_RETRIES;
+ tv.tv_usec = 1000000 * (RPC_TIMEOUT % RPC_RETRIES) / RPC_RETRIES;
ysd->dom_client = clntudp_create(&ysd->dom_server_addr,
! YPPROG, YPVERS, tv, &ysd->dom_socket);
if (ysd->dom_client == NULL) {
clnt_pcreateerror("clntudp_create");
ysd->dom_vers = -1;
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->analyzed
State-Changed-By: thorpej
State-Changed-When: Tue Jan 21 11:44:15 PST 1997
State-Changed-Why:
This is indeed a bug. This patch won't work "as-is" since the -current
libc has changed somewhat.
Responsible-Changed-From-To: lib-bug-people->thorpej
Responsible-Changed-By: thorpej
Responsible-Changed-When: Tue Jan 21 11:44:15 PST 1997
Responsible-Changed-Why:
I'll take care of this.
State-Changed-From-To: analyzed->closed
State-Changed-By: thorpej
State-Changed-When: Tue Jan 21 12:36:45 PST 1997
State-Changed-Why:
Suggested fix applied, slightly modified to compute the rpc timeout
only once at compile-time, rather than N times at run-time.
Thanks!
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.49 2026/05/14 01:52:41 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.