diff options
author | David Hankins <dhankins@isc.org> | 2006-07-20 16:02:52 +0000 |
---|---|---|
committer | David Hankins <dhankins@isc.org> | 2006-07-20 16:02:52 +0000 |
commit | 7e0ab8c43d98aed167779748c3600a7802177985 (patch) | |
tree | 08ecff48d80d4342c34af476cb94fc0083bf0376 | |
parent | 1fd3bc80b8b7b6c44f11833e7897271228885150 (diff) | |
download | isc-dhcp-7e0ab8c43d98aed167779748c3600a7802177985.tar.gz |
- 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). [ISC-Bugs #15533]
-rw-r--r-- | RELNOTES | 5 | ||||
-rw-r--r-- | server/confpars.c | 16 |
2 files changed, 20 insertions, 1 deletions
@@ -129,6 +129,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 diff --git a/server/confpars.c b/server/confpars.c index c1c4a7d2..cb081037 100644 --- a/server/confpars.c +++ b/server/confpars.c @@ -34,7 +34,7 @@ #ifndef lint static char copyright[] = -"$Id: confpars.c,v 1.143.2.31 2006/05/05 20:03:24 dhankins Exp $ Copyright (c) 2004-2006 Internet Systems Consortium. All rights reserved.\n"; +"$Id: confpars.c,v 1.143.2.32 2006/07/20 16:02:52 dhankins Exp $ Copyright (c) 2004-2006 Internet Systems Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -507,6 +507,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; @@ -1731,6 +1738,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) { |