From 6c3ebebd1eddb7041248125fa5e228380400c436 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 29 Aug 2001 23:31:38 +0000 Subject: Update. 2001-08-29 Ulrich Drepper * nis/nis_findserv.c (__nis_findfastest): Don't fail if reply received first is from a previous call. Patch by Alexander Belopolsky for [PR libc/3670]. 2001-08-29 Andreas Schwab * sysdeps/ia64/fpu/libm-test-ulps: Updated. 2001-08-25 Maciej W. Rozycki * config.make.in (INSTALL_SCRIPT): Define. * Makeconfig (INSTALL_SCRIPT): Define. * Makerules (do-install-script): New macro to install scripts using INSTALL_SCRIPT. (install-bin-script): New rule to install scripts with do-install-script. (install-bin-script-nosubdir): New rule. (install-no-libc.a-nosubdir): Add install-bin-script-nosubdir. (distinfo-vars): Add $(install-bin-script). * Rules (others): Likewise. * Makefile (glibcbug): Install with install-bin-script. * debug/Makefile (xtrace): Likewise. (catchsegv): Likewise. * elf/Makefile (ldd): Likewise. * malloc/Makefile (mtrace): Likewise. * timezone/Makefile (tzselect): Likewise. 2001-08-29 H.J. Lu * sysdeps/mips/dl-machine.h (__dl_runtime_resolve): Pass ELF_RTYPE_CLASS_PLT, instead of R_MIPS_REL32, to _dl_lookup_versioned_symbol () and _dl_lookup_symbol (). Add it to LDFLAGS.so, LDFLAGS-rtld, and +link. --- nis/nis_findserv.c | 45 +++++++++++++++++++++++---------------------- 1 file changed, 23 insertions(+), 22 deletions(-) (limited to 'nis/nis_findserv.c') diff --git a/nis/nis_findserv.c b/nis/nis_findserv.c index 8152f55..a82c115 100644 --- a/nis/nis_findserv.c +++ b/nis/nis_findserv.c @@ -135,12 +135,10 @@ __nis_findfastest (dir_binding *bind) struct findserv_req *pings; struct sockaddr_in sin, saved_sin; int found = -1; - u_int32_t xid_seed, xid_lookup; + u_int32_t xid_seed; int sock, dontblock = 1; CLIENT *clnt; - char clnt_res; - void *foo = NULL; - u_long i, j, pings_count, pings_max; + u_long i, j, pings_count, pings_max, fastest = -1; struct cu_data *cu; pings_max = bind->server_len * 2; /* Reserve a little bit more memory @@ -188,10 +186,9 @@ __nis_findfastest (dir_binding *bind) memcpy ((char *) &pings[pings_count].sin, (char *) &sin, sizeof (sin)); memcpy ((char *)&saved_sin, (char *)&sin, sizeof(sin)); - pings[pings_count].xid = xid_seed; + pings[pings_count].xid = xid_seed + pings_count; pings[pings_count].server_nr = i; pings[pings_count].server_ep = j; - ++xid_seed; ++pings_count; } @@ -225,26 +222,30 @@ __nis_findfastest (dir_binding *bind) memcpy ((char *) &cu->cu_raddr, (char *) &pings[i].sin, sizeof (struct sockaddr_in)); /* Transmit to NULLPROC, return immediately. */ - clnt_call (clnt, NULLPROC, (xdrproc_t) xdr_void, (caddr_t) foo, - (xdrproc_t) xdr_void, (caddr_t) & clnt_res, TIMEOUT00); + clnt_call (clnt, NULLPROC, + (xdrproc_t) xdr_void, (caddr_t) 0, + (xdrproc_t) xdr_void, (caddr_t) 0, TIMEOUT00); } - + /* Receive reply from NULLPROC asynchronously */ - memset ((char *) &clnt_res, 0, sizeof (clnt_res)); - clnt_call (clnt, NULLPROC, (xdrproc_t) NULL, (caddr_t) foo, - (xdrproc_t) xdr_void, (caddr_t) &clnt_res, TIMEOUT00); - - xid_lookup = *((u_int32_t *) (cu->cu_inbuf)); - for (i = 0; i < pings_count; i++) + while (RPC_SUCCESS == clnt_call (clnt, NULLPROC, + (xdrproc_t) NULL, (caddr_t) 0, + (xdrproc_t) xdr_void, (caddr_t) 0, + TIMEOUT00)) { - if (pings[i].xid == xid_lookup) - { - bind->server_used = pings[i].server_nr; - bind->current_ep = pings[i].server_ep; - found = 1; - } + fastest = *((u_int32_t *) (cu->cu_inbuf)) - xid_seed; + if (fastest < pings_count) { + break; + } } - + + if (fastest < pings_count) + { + bind->server_used = pings[fastest].server_nr; + bind->current_ep = pings[fastest].server_ep; + found = 1; + } + auth_destroy (clnt->cl_auth); clnt_destroy (clnt); close (sock); -- cgit v1.1