summaryrefslogtreecommitdiff
path: root/usr.sbin/dhcpd/dhcpd.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/dhcpd/dhcpd.c')
-rw-r--r--usr.sbin/dhcpd/dhcpd.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/usr.sbin/dhcpd/dhcpd.c b/usr.sbin/dhcpd/dhcpd.c
index da47b598910..dc2fa85a51c 100644
--- a/usr.sbin/dhcpd/dhcpd.c
+++ b/usr.sbin/dhcpd/dhcpd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dhcpd.c,v 1.38 2008/05/29 19:02:47 deraadt Exp $ */
+/* $OpenBSD: dhcpd.c,v 1.39 2010/04/19 12:22:09 claudio Exp $ */
/*
* Copyright (c) 2004 Henning Brauer <henning@cvs.openbsd.org>
@@ -71,7 +71,7 @@ struct syslog_data sdata = SYSLOG_DATA_INIT;
int
main(int argc, char *argv[])
{
- int ch, cftest = 0, daemonize = 1;
+ int ch, cftest = 0, daemonize = 1, rdomain = -1;
extern char *__progname;
char *sync_iface = NULL;
char *sync_baddr = NULL;
@@ -168,17 +168,21 @@ main(int argc, char *argv[])
if (cftest)
exit(0);
+ db_startup();
+ discover_interfaces(&rdomain);
+
+ if (rdomain != -1)
+ if (setrdomain(rdomain) == -1)
+ error("setrdomain (%m)");
+
+ icmp_startup(1, lease_pinged);
+
if (syncsend || syncrecv) {
syncfd = sync_init(sync_iface, sync_baddr, sync_port);
if (syncfd == -1)
err(1, "sync init");
}
- db_startup();
- discover_interfaces();
- icmp_startup(1, lease_pinged);
-
-
if ((pw = getpwnam("_dhcp")) == NULL)
error("user \"_dhcp\" not found");