summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ypbind
diff options
context:
space:
mode:
authorotto <otto@openbsd.org>2007-01-02 20:10:48 +0000
committerotto <otto@openbsd.org>2007-01-02 20:10:48 +0000
commit1952252eb8d408f2de130f0bf702b7d47b208d33 (patch)
treec80d0c802889c325842d591420ff6c19e49d50d3 /usr.sbin/ypbind
parentUse the value returned by pci_findproduct() as the timedelta sensor description (diff)
downloadwireguard-openbsd-1952252eb8d408f2de130f0bf702b7d47b208d33.tar.xz
wireguard-openbsd-1952252eb8d408f2de130f0bf702b7d47b208d33.zip
Fix setting up the more specific binding for the ypsetme
functionality. We want to bind to the same ports as the general binding, but with a local address. with and ok deraadt@
Diffstat (limited to 'usr.sbin/ypbind')
-rw-r--r--usr.sbin/ypbind/ypbind.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.sbin/ypbind/ypbind.c b/usr.sbin/ypbind/ypbind.c
index 0987f2417f6..07731ffbece 100644
--- a/usr.sbin/ypbind/ypbind.c
+++ b/usr.sbin/ypbind/ypbind.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ypbind.c,v 1.53 2006/04/02 01:29:51 deraadt Exp $ */
+/* $OpenBSD: ypbind.c,v 1.54 2007/01/02 20:10:48 otto Exp $ */
/*
* Copyright (c) 1992, 1993, 1996, 1997, 1998 Theo de Raadt <deraadt@openbsd.org>
@@ -27,7 +27,7 @@
*/
#ifndef lint
-static char rcsid[] = "$OpenBSD: ypbind.c,v 1.53 2006/04/02 01:29:51 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: ypbind.c,v 1.54 2007/01/02 20:10:48 otto Exp $";
#endif
#include <sys/param.h>
@@ -440,7 +440,7 @@ main(int argc, char *argv[])
exit(1);
}
sin.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
- sin.sin_port = 0;
+ sin.sin_port = htons(udptransp->xp_port);
if (bind(lsock, (struct sockaddr *)&sin, len) != 0) {
syslog(LOG_ERR, "cannot bind local udp: %m");
exit(1);
@@ -464,9 +464,9 @@ main(int argc, char *argv[])
exit(1);
}
sin.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
- sin.sin_port = 0;
+ sin.sin_port = htons(tcptransp->xp_port);
if (bind(lsock, (struct sockaddr *)&sin, len) == -1) {
- syslog(LOG_ERR, "cannot bind udp: %m");
+ syslog(LOG_ERR, "cannot bind local tcp: %m");
exit(1);
}
if ((ltcptransp = svctcp_create(lsock, 0, 0)) == NULL) {