]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
Support host declarations in lease database file.
authorTed Lemon <source@isc.org>
Thu, 9 Sep 1999 21:11:27 +0000 (21:11 +0000)
committerTed Lemon <source@isc.org>
Thu, 9 Sep 1999 21:11:27 +0000 (21:11 +0000)
server/confpars.c
server/dhcpd.c

index 0487932207c9d530dcfe004187aaf6f8ff9cf5e4..70ebdb811e95684fe50136e578435f963dc46b04 100644 (file)
@@ -22,7 +22,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: confpars.c,v 1.77 1999/09/08 01:49:56 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium.  All rights reserved.\n";
+"$Id: confpars.c,v 1.78 1999/09/09 21:11:21 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -98,16 +98,18 @@ void read_leases ()
                token = next_token (&val, cfile);
                if (token == EOF)
                        break;
-               if (token != LEASE) {
-                       log_error ("Corrupt lease file - possible data loss!");
-                       skip_to_semi (cfile);
-               } else {
+               if (token == LEASE) {
                        struct lease *lease;
                        lease = parse_lease_declaration (cfile);
                        if (lease)
                                enter_lease (lease);
                        else
                                parse_warn ("possibly corrupt lease file");
+               } else if (token == HOST) {
+                       parse_host_declaration (cfile, &root_group);
+               } else {
+                       log_error ("Corrupt lease file - possible data loss!");
+                       skip_to_semi (cfile);
                }
 
        } while (1);
@@ -944,7 +946,7 @@ void parse_host_declaration (cfile, group)
                                               declaration);
        } while (1);
 
-       enter_host (host, dynamicp);
+       enter_host (host, dynamicp, 0);
 }
 
 /* class-declaration :== STRING LBRACE parameters declarations RBRACE
index 7fa2a8c15a00b8cdb127968b0dc072c8e14330cc..d55b93c33c3af754fed5c0c3df6606c38685f0ea 100644 (file)
@@ -22,7 +22,7 @@
 
 #ifndef lint
 static char ocopyright[] =
-"$Id: dhcpd.c,v 1.72 1999/09/08 01:50:19 mellon Exp $ Copyright 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium.";
+"$Id: dhcpd.c,v 1.73 1999/09/09 21:11:27 mellon Exp $ Copyright 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium.";
 #endif
 
   static char copyright[] =
@@ -214,6 +214,16 @@ int main (argc, argv, envp)
        /* Set up the client classification system. */
        classification_setup ();
 
+       /* Initialize the omapi system. */
+       status = omapi_init ();
+       if (status != ISC_R_SUCCESS)
+               log_fatal ("Can't initialize OMAPI: %s\n",
+                          isc_result_totext (status));
+
+       /* Set up the OMAPI wrappers for various server database internal
+          objects. */
+       dhcp_db_objects_setup ();
+
        /* Read the dhcpd.conf file... */
        if (!readconf ())
                log_fatal ("Configuration file errors encountered -- exiting");
@@ -256,11 +266,7 @@ int main (argc, argv, envp)
                                        OMAPI_PROTOCOL_PORT, 1);
        if (status != ISC_R_SUCCESS)
                log_fatal ("Can't start OMAPI protocol: %s",
-                          isc_result_totext (result));
-
-       /* Set up the OMAPI wrappers for various server database internal
-          objects. */
-       dhcp_db_objects_setup ();
+                          isc_result_totext (status));
 
 #ifndef DEBUG
        if (daemon) {