diff options
author | dm <dm@cvs.openbsd.org> | 1996-03-02 04:55:03 +0000 |
---|---|---|
committer | dm <dm@cvs.openbsd.org> | 1996-03-02 04:55:03 +0000 |
commit | 77e612e8ddc74849d1e0af5991485606f0035f2e (patch) | |
tree | 47e8bde831e48ee2a5d4bbee48326869cb57447f /usr.sbin/ypserv | |
parent | 941923ed2c72088daeca8c707ae993731a1b7410 (diff) |
Using TCP broke ypxfr -C which in turn caused yppush to fail on the
master NIS server. I gave yp_bind_host an extra argument to select
TCP/UDP transport.
Diffstat (limited to 'usr.sbin/ypserv')
-rw-r--r-- | usr.sbin/ypserv/common/yplib_host.c | 19 | ||||
-rw-r--r-- | usr.sbin/ypserv/common/yplib_host.h | 2 | ||||
-rw-r--r-- | usr.sbin/ypserv/yppush/yppush.c | 4 | ||||
-rw-r--r-- | usr.sbin/ypserv/ypxfr/ypxfr.c | 7 |
4 files changed, 18 insertions, 14 deletions
diff --git a/usr.sbin/ypserv/common/yplib_host.c b/usr.sbin/ypserv/common/yplib_host.c index 56ed23af380..18930a3dc8a 100644 --- a/usr.sbin/ypserv/common/yplib_host.c +++ b/usr.sbin/ypserv/common/yplib_host.c @@ -30,7 +30,7 @@ */ #ifndef LINT -static char *rcsid = "$Id: yplib_host.c,v 1.2 1996/03/02 03:01:31 dm Exp $"; +static char *rcsid = "$Id: yplib_host.c,v 1.3 1996/03/02 04:54:58 dm Exp $"; #endif #include <sys/param.h> @@ -64,10 +64,11 @@ extern void *ypresp_data; int _yplib_host_timeout = 10; CLIENT * -yp_bind_host(server,program,version,port) +yp_bind_host(server,program,version,port,usetcp) char *server; u_long program,version; u_short port; +int usetcp; { struct sockaddr_in rsrv_sin; int rsrv_sock; @@ -102,12 +103,14 @@ u_short port; tv.tv_sec = 10; tv.tv_usec = 0; -#if 0 - client = clntudp_create(&rsrv_sin, program, version, tv, &rsrv_sock); -#else - client = clnttcp_create(&rsrv_sin, program, version, &rsrv_sock, - 0, 0); -#endif + if (usetcp) { + client = clnttcp_create(&rsrv_sin, program, version, + &rsrv_sock, 0, 0); + } else { + client = clntudp_create(&rsrv_sin, program, version, tv, + &rsrv_sock); + } + if (client == NULL) { fprintf(stderr, "clntudp_create: no contact with host %s.\n", server); diff --git a/usr.sbin/ypserv/common/yplib_host.h b/usr.sbin/ypserv/common/yplib_host.h index 54d8d66a9bc..c8d74e71862 100644 --- a/usr.sbin/ypserv/common/yplib_host.h +++ b/usr.sbin/ypserv/common/yplib_host.h @@ -53,7 +53,7 @@ int yp_maplist_host __P((CLIENT *client, char *indomain, struct ypmaplist **outmaplist)); CLIENT *yp_bind_local __P((u_long program, u_long version)); CLIENT *yp_bind_host __P((char *server, u_long program, u_long version, - u_short port)); + u_short port, int usetcp)); #endif /* _YPLIB_HOST_H_ */ diff --git a/usr.sbin/ypserv/yppush/yppush.c b/usr.sbin/ypserv/yppush/yppush.c index 71e0c96baf5..214d2497b27 100644 --- a/usr.sbin/ypserv/yppush/yppush.c +++ b/usr.sbin/ypserv/yppush/yppush.c @@ -30,7 +30,7 @@ */ #ifndef lint -static char rcsid[] = "$Id: yppush.c,v 1.1 1996/03/02 03:01:43 dm Exp $"; +static char rcsid[] = "$Id: yppush.c,v 1.2 1996/03/02 04:55:00 dm Exp $"; #endif /* not lint */ /* @@ -342,7 +342,7 @@ char **argv; printf("Contacting master for ypservers (%s).\n", master); } - client = yp_bind_host(master, YPPROG, YPVERS, 0); + client = yp_bind_host(master, YPPROG, YPVERS, 0, 1); ypcb.foreach = pushit; ypcb.data = NULL; diff --git a/usr.sbin/ypserv/ypxfr/ypxfr.c b/usr.sbin/ypserv/ypxfr/ypxfr.c index 535d47dcd1d..693fdc16073 100644 --- a/usr.sbin/ypserv/ypxfr/ypxfr.c +++ b/usr.sbin/ypserv/ypxfr/ypxfr.c @@ -30,7 +30,7 @@ */ #ifndef LINT -static char rcsid[] = "$Id: ypxfr.c,v 1.4 1996/03/02 03:42:06 dm Exp $"; +static char rcsid[] = "$Id: ypxfr.c,v 1.5 1996/03/02 04:55:02 dm Exp $"; #endif #include <stdio.h> @@ -545,7 +545,7 @@ char *argv[]; yplog("Connect host: %s", host); - client = yp_bind_host(host,YPPROG,YPVERS,0); + client = yp_bind_host(host,YPPROG,YPVERS,0,1); status = get_remote_ordernum(client,domain,map, ordernum,&new_ordernum); @@ -619,7 +619,8 @@ char *argv[]; client = yp_bind_host(ipadd, atoi(prog), 1, - atoi(port)); + atoi(port), + 0); status = send_reply(client,xfr_status,atoi(tid)); clnt_destroy(client); } |