diff options
author | dfr <dfr@FreeBSD.org> | 2008-09-15 14:01:40 +0000 |
---|---|---|
committer | dfr <dfr@FreeBSD.org> | 2008-09-15 14:01:40 +0000 |
commit | e0f67daaea9a4bd084a159ca52bce34fb0119a84 (patch) | |
tree | 4c94f8259e89a18dcb563dbdeebef99134b84bcf /usr.sbin | |
parent | 903c5962c0de42ecab23bb1d4ef0de9837ba9a2f (diff) | |
download | FreeBSD-src-e0f67daaea9a4bd084a159ca52bce34fb0119a84.zip FreeBSD-src-e0f67daaea9a4bd084a159ca52bce34fb0119a84.tar.gz |
Don't rely on private RPC data structures when there is a perfectly good
public API.
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/ypbind/yp_ping.c | 26 |
1 files changed, 4 insertions, 22 deletions
diff --git a/usr.sbin/ypbind/yp_ping.c b/usr.sbin/ypbind/yp_ping.c index 1806c3c..1453126 100644 --- a/usr.sbin/ypbind/yp_ping.c +++ b/usr.sbin/ypbind/yp_ping.c @@ -95,24 +95,6 @@ __FBSDID("$FreeBSD$"); #include "yp_ping.h" -struct cu_data { - int cu_fd; /* connections fd */ - bool_t cu_closeit; /* opened by library */ - struct sockaddr_storage cu_raddr; /* remote address */ - int cu_rlen; - struct timeval cu_wait; /* retransmit interval */ - struct timeval cu_total; /* total time for the call */ - struct rpc_err cu_error; - XDR cu_outxdrs; - u_int cu_xdrpos; - u_int cu_sendsz; /* send size */ - char *cu_outbuf; - u_int cu_recvsz; /* recv size */ - struct pollfd pfdp; - int cu_async; - char cu_inbuf[1]; -}; - /* * pmap_getport.c * Client interface to pmap rpc service. @@ -237,12 +219,12 @@ __yp_ping(struct in_addr *restricted_addrs, int cnt, char *dom, short *port) unsigned long i; int async; struct sockaddr_in sin, *any = NULL; + struct netbuf addr; int winner = -1; u_int32_t xid_seed, xid_lookup; int sock, dontblock = 1; CLIENT *clnt; char *foo = dom; - struct cu_data *cu; int validsrvs = 0; /* Set up handles. */ @@ -284,7 +266,6 @@ __yp_ping(struct in_addr *restricted_addrs, int cnt, char *dom, short *port) return(-1); } clnt->cl_auth = authunix_create_default(); - cu = (struct cu_data *)clnt->cl_private; tv.tv_sec = 0; clnt_control(clnt, CLSET_TIMEOUT, (char *)&tv); @@ -296,8 +277,9 @@ __yp_ping(struct in_addr *restricted_addrs, int cnt, char *dom, short *port) for (i = 0; i < cnt; i++) { if (reqs[i] != NULL) { clnt_control(clnt, CLSET_XID, (char *)&reqs[i]->xid); - bcopy((char *)&reqs[i]->sin, (char *)&cu->cu_raddr, - sizeof(struct sockaddr_in)); + addr.len = sizeof(reqs[i]->sin); + addr.buf = (char *) &reqs[i]->sin; + clnt_control(clnt, CLSET_SVC_ADDR, &addr); ypproc_domain_nonack_2_send(&foo, clnt); } } |