diff options
Diffstat (limited to 'usr.sbin/ypset/ypset.c')
-rw-r--r-- | usr.sbin/ypset/ypset.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/usr.sbin/ypset/ypset.c b/usr.sbin/ypset/ypset.c index 0f13ec4d02d..98620c7d0d9 100644 --- a/usr.sbin/ypset/ypset.c +++ b/usr.sbin/ypset/ypset.c @@ -41,7 +41,7 @@ static char rcsid[] = "ypset.c,v 1.3 1993/06/12 00:02:37 deraadt Exp"; #include <netdb.h> #include <rpc/rpc.h> #include <rpc/xdr.h> -#include <rpcsvc/yp_prot.h> +#include <rpcsvc/yp.h> #include <rpcsvc/ypclnt.h> #include <arpa/inet.h> @@ -64,6 +64,7 @@ char *dom, *server; CLIENT *client; int sock, port; int r; + struct in_addr iaddr; if( (port=htons(getrpcport(server, YPPROG, YPPROC_NULL, IPPROTO_UDP))) == 0) { fprintf(stderr, "%s not running ypserv.\n", server); @@ -72,17 +73,19 @@ char *dom, *server; bzero(&ypsd, sizeof ypsd); - if (inet_aton(server, &ypsd.ypsetdom_addr) == 0) { + if (inet_aton(server, &iaddr) == 0) { hp = gethostbyname(server); if (hp == NULL) { fprintf(stderr, "ypset: can't find address for %s\n", server); exit(1); } - bcopy(hp->h_addr, &ypsd.ypsetdom_addr, sizeof(ypsd.ypsetdom_addr)); + bcopy(hp->h_addr, &iaddr, sizeof(iaddr)); } - - strncpy(ypsd.ypsetdom_domain, dom, sizeof ypsd.ypsetdom_domain); - ypsd.ypsetdom_port = port; + ypsd.ypsetdom_domain = dom; + bcopy(&iaddr, &ypsd.ypsetdom_binding.ypbind_binding_addr, + sizeof(ypsd.ypsetdom_binding.ypbind_binding_addr)); + bcopy(&port, &ypsd.ypsetdom_binding.ypbind_binding_port, + sizeof(ypsd.ypsetdom_binding.ypbind_binding_port)); ypsd.ypsetdom_vers = YPVERS; tv.tv_sec = 15; |