summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1998-08-03 16:53:17 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1998-08-03 16:53:17 +0000
commitcc319f7a8e54704c0b3d2349ea391318c004b24e (patch)
tree82afa87ed79e88d43dfa77499319cebbf09c2807 /usr.sbin
parent33ac9393c89157da8f282d430efad6a292c3fea4 (diff)
Set SO_REUSEADDR on printer/tcp service (port 515); csapuntz@clearviewtech.com
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/lpr/lpd/lpd.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/usr.sbin/lpr/lpd/lpd.c b/usr.sbin/lpr/lpd/lpd.c
index d883a03b184..42befc9a1c2 100644
--- a/usr.sbin/lpr/lpd/lpd.c
+++ b/usr.sbin/lpr/lpd/lpd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lpd.c,v 1.15 1997/08/04 19:26:13 deraadt Exp $ */
+/* $OpenBSD: lpd.c,v 1.16 1998/08/03 16:53:16 millert Exp $ */
/* $NetBSD: lpd.c,v 1.7 1996/04/24 14:54:06 mrg Exp $ */
/*
@@ -45,7 +45,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)lpd.c 8.7 (Berkeley) 5/10/95";
#else
-static char rcsid[] = "$OpenBSD: lpd.c,v 1.15 1997/08/04 19:26:13 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: lpd.c,v 1.16 1998/08/03 16:53:16 millert Exp $";
#endif
#endif /* not lint */
@@ -221,11 +221,15 @@ main(argc, argv)
if (finet >= 0) {
struct servent *sp;
- if (options & SO_DEBUG)
+ if (options & SO_DEBUG) {
if (setsockopt(finet, SOL_SOCKET, SO_DEBUG, 0, 0) < 0) {
syslog(LOG_ERR, "setsockopt (SO_DEBUG): %m");
mcleanup(0);
}
+ }
+ f = 1;
+ (void) setsockopt(finet, SOL_SOCKET, SO_REUSEADDR, &f,
+ sizeof(f));
sp = getservbyname("printer", "tcp");
if (sp == NULL) {
syslog(LOG_ERR, "printer/tcp: unknown service");