]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
- Host declaration hardware addresses and client identifiers may only be
authorDavid Hankins <dhankins@isc.org>
Thu, 20 Jul 2006 16:04:03 +0000 (16:04 +0000)
committerDavid Hankins <dhankins@isc.org>
Thu, 20 Jul 2006 16:04:03 +0000 (16:04 +0000)
  configured once.  dhcpd will now fail to load config files that specify
  multiple identifiers (previous versions would silently over-ride the
  value with the later configured value). [ISC-Bugs #15533]

RELNOTES
server/confpars.c

index a2e377c58d2c917227830f461aed61176f625935..f44dc64e4e961534a066c47dc2fb962217906e9e 100644 (file)
--- a/RELNOTES
+++ b/RELNOTES
@@ -193,6 +193,11 @@ and for prodding me into improving it.
   encountering non-retryable errors during writing) lease file should
   no longer result in an infinite recursion.
 
+- Host declaration hardware addresses and client identifiers may only be
+  configured once.  dhcpd will now fail to load config files that specify
+  multiple identifiers (previous versions would silently over-ride the
+  value with the later configured value).
+
                        Changes since 3.0.4rc1
 
 - The dhcp-options.5 manpage was updated to correct indentation errors
index 06c74cf557a11192df9115cedbab26b3d3bc582c..a8907e70857e71f9c49cc9ed16cf043d06ec7593 100644 (file)
@@ -34,7 +34,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: confpars.c,v 1.157 2006/06/16 19:26:44 dhankins Exp $ Copyright (c) 2004-2006 Internet Systems Consortium.  All rights reserved.\n";
+"$Id: confpars.c,v 1.158 2006/07/20 16:04:03 dhankins Exp $ Copyright (c) 2004-2006 Internet Systems Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -515,6 +515,13 @@ int parse_statement (cfile, group, type, host_decl, declaration)
              case HARDWARE:
                next_token (&val, (unsigned *)0, cfile);
                memset (&hardware, 0, sizeof hardware);
+               if (host_decl && memcmp(&hardware, &(host_decl->interface),
+                                       sizeof(hardware)) != 0) {
+                       parse_warn(cfile, "Host %s hardware address already "
+                                         "configured.", host_decl->name);
+                       break;
+               }
+
                parse_hardware_param (cfile, &hardware);
                if (host_decl)
                        host_decl -> interface = hardware;
@@ -1765,6 +1772,13 @@ void parse_host_declaration (cfile, group)
                        token = next_token (&val, (unsigned *)0, cfile);
                        data_string_forget (&host -> client_identifier, MDL);
 
+                       if (host->client_identifier.len != 0) {
+                               parse_warn(cfile, "Host %s already has a "
+                                                 "client identifier.",
+                                          host->name);
+                               break;
+                       }
+
                        /* See if it's a string or a cshl. */
                        token = peek_token (&val, (unsigned *)0, cfile);
                        if (token == STRING) {