From cc319f7a8e54704c0b3d2349ea391318c004b24e Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Mon, 3 Aug 1998 16:53:17 +0000 Subject: Set SO_REUSEADDR on printer/tcp service (port 515); csapuntz@clearviewtech.com --- usr.sbin/lpr/lpd/lpd.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'usr.sbin') 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"); -- cgit v1.2.3