check pmap_flag before sendto.

This commit is contained in:
yamt 2001-09-28 08:45:41 +00:00
parent 4cf8a6a821
commit 22e098af0f
1 changed files with 4 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: clnt_bcast.c,v 1.5 2001/05/08 23:21:17 lukem Exp $ */
/* $NetBSD: clnt_bcast.c,v 1.6 2001/09/28 08:45:41 yamt Exp $ */
/*
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
@ -282,13 +282,14 @@ rpc_broadcast_exp(prog, vers, proc, xargs, argsp, xresults, resultsp,
size_t fdlistno = 0;
struct r_rpcb_rmtcallargs barg; /* Remote arguments */
struct r_rpcb_rmtcallres bres; /* Remote results */
size_t outlen, outlen_pmap;
size_t outlen;
struct netconfig *nconf;
int msec;
int pollretval;
int fds_found;
#ifdef PORTMAP
size_t outlen_pmap;
u_long port; /* Remote port number */
int pmap_flag = 0; /* UDP exists ? */
char *outbuf_pmap = NULL;
@ -485,7 +486,7 @@ rpc_broadcast_exp(prog, vers, proc, xargs, argsp, xresults, resultsp,
* Send the version 2 packet also
* for UDP/IP
*/
if (fdlist[i].proto == IPPROTO_UDP) {
if (pmap_flag && fdlist[i].proto == IPPROTO_UDP) {
if (sendto(fdlist[i].fd, outbuf_pmap,
outlen_pmap, 0, addr,
(size_t)fdlist[i].asize) !=