-.\" $OpenBSD: dhcpd.8,v 1.33 2023/09/04 16:11:00 jmc Exp $
+.\" $OpenBSD: dhcpd.8,v 1.34 2023/10/05 18:46:14 mvs Exp $
.\"
.\" Copyright (c) 1995, 1996 The Internet Software Consortium.
.\" All rights reserved.
.\" see ``http://www.isc.org/''. To learn more about Vixie
.\" Enterprises, see ``http://www.vix.com''.
.\"
-.Dd $Mdocdate: September 4 2023 $
+.Dd $Mdocdate: October 5 2023 $
.Dt DHCPD 8
.Os
.Sh NAME
.Sh SYNOPSIS
.Nm dhcpd
.Bk -words
-.Op Fl dfn
+.Op Fl dfnv
.Op Fl A Ar abandoned_ip_table
.Op Fl C Ar changed_ip_table
.Op Fl c Ar config-file
.Nm
will bind to that address; otherwise
the limited broadcast address (255.255.255.255) is used as the default.
+.It Fl v
+Produce more verbose output.
.It Fl Y Ar synctarget
Add target
.Ar synctarget
-/* $OpenBSD: dhcpd.c,v 1.57 2019/08/06 11:07:37 krw Exp $ */
+/* $OpenBSD: dhcpd.c,v 1.58 2023/10/05 18:46:14 mvs Exp $ */
/*
* Copyright (c) 2004 Henning Brauer <henning@cvs.openbsd.org>
int
main(int argc, char *argv[])
{
- int ch, cftest = 0, daemonize = 1, rdomain = -1, udpsockmode = 0;
+ int ch, cftest = 0, rdomain = -1, udpsockmode = 0;
+ int debug = 0, verbose = 0;
char *sync_iface = NULL;
char *sync_baddr = NULL;
u_short sync_port = 0;
log_setverbose(1);
opterr = 0;
- while ((ch = getopt(argc, argv, "A:C:L:c:dfl:nu::Y:y:")) != -1)
+ while ((ch = getopt(argc, argv, "A:C:L:c:dfl:nu::vY:y:")) != -1)
switch (ch) {
case 'Y':
syncsend = 1;
udpaddr.s_addr = htonl(INADDR_BROADCAST);
optreset = optind = opterr = 1;
- while ((ch = getopt(argc, argv, "A:C:L:c:dfl:nu::Y:y:")) != -1)
+ while ((ch = getopt(argc, argv, "A:C:L:c:dfl:nu::vY:y:")) != -1)
switch (ch) {
case 'A':
abandoned_tab = optarg;
path_dhcpd_conf = optarg;
break;
case 'd':
- daemonize = 0;
- break;
+ /* FALLTHROUGH */
case 'f':
- daemonize = 0;
+ debug = 1;
break;
case 'l':
path_dhcpd_db = optarg;
break;
case 'n':
- daemonize = 0;
+ debug = 1;
cftest = 1;
break;
case 'u':
"address: %s", optarg);
}
break;
+ case 'v':
+ verbose = 1;
+ break;
case 'Y':
if (sync_addhost(optarg, sync_port) != 0)
sync_iface = optarg;
err(1, "sync init");
}
- if (daemonize)
- daemon(0, 0);
+ log_init(debug, LOG_DAEMON);
+ log_setverbose(verbose);
- log_init(0, LOG_DAEMON); /* stop logging to stderr */
- log_setverbose(0);
+ if (!debug)
+ daemon(0, 0);
if ((pw = getpwnam("_dhcp")) == NULL)
fatalx("user \"_dhcp\" not found");