summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Hankins <dhankins@isc.org>2008-01-22 17:19:30 +0000
committerDavid Hankins <dhankins@isc.org>2008-01-22 17:19:30 +0000
commitbeac7df913d8e84cc20534fae02461a1efdc6f0f (patch)
treefeb355cf930815087682d241b9aaa3c1cbb65e37
parent2dbbc6fef370573620805fa6399f3bc09966d7b6 (diff)
downloadisc-dhcp-beac7df913d8e84cc20534fae02461a1efdc6f0f.tar.gz
- When server is configured with options that it overrides, a warning is
issued when the configuration file is read, rather than at the time the option is overridden. This was important, because the warning was given every time the option was overridden, which could create a lot of unnecessary logging. [ISC-Bugs #17382]
-rw-r--r--RELNOTES6
-rw-r--r--server/confpars.c21
-rw-r--r--server/dhcp.c11
3 files changed, 27 insertions, 11 deletions
diff --git a/RELNOTES b/RELNOTES
index fd4aceb6..b4f8ca3d 100644
--- a/RELNOTES
+++ b/RELNOTES
@@ -123,6 +123,12 @@ and for prodding me into improving it.
'address' parameter (the server's local address) did not resolve to an
IPv4 address.
+- When server is configured with options that it overrides, a warning is
+ issued when the configuration file is read, rather than at the time the
+ option is overridden. This was important, because the warning was given
+ every time the option was overridden, which could create a lot of
+ unnecessary logging.
+
- When a failover server suspects it has encountered a peer running a
version 3.1.x failover server, a warning that the failover wire protocol
is incompatible is printed.
diff --git a/server/confpars.c b/server/confpars.c
index 97880279..122672a6 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.38 2007/07/11 16:11:28 dhankins Exp $ Copyright (c) 2004-2006 Internet Systems Consortium. All rights reserved.\n";
+"$Id: confpars.c,v 1.143.2.39 2008/01/22 17:19:30 dhankins Exp $ Copyright (c) 2004-2006 Internet Systems Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
@@ -644,6 +644,25 @@ int parse_statement (cfile, group, type, host_decl, declaration)
return declaration;
}
+ /*
+ * If the configuration attempts to define on option
+ * that we ignore, then warn about it now.
+ *
+ * In DHCPv4 we do not use dhcp-renewal-time or
+ * dhcp-rebinding-time, but we use these in DHCPv6.
+ *
+ * XXX: We may want to include a "blacklist" of
+ * options we ignore in the future, as a table.
+ */
+ if ((option->code == DHO_DHCP_LEASE_TIME) ||
+ (option->code == DHO_DHCP_RENEWAL_TIME) ||
+ (option->code == DHO_DHCP_REBINDING_TIME))
+ {
+ log_error("WARNING: server ignoring option %s "
+ "in configuration file.",
+ option->name);
+ }
+
finish_option:
et = (struct executable_statement *)0;
if (!parse_option_statement
diff --git a/server/dhcp.c b/server/dhcp.c
index 40e4f6b3..9f0c506d 100644
--- a/server/dhcp.c
+++ b/server/dhcp.c
@@ -34,7 +34,7 @@
#ifndef lint
static char copyright[] =
-"$Id: dhcp.c,v 1.192.2.70 2008/01/22 17:13:16 dhankins Exp $ Copyright (c) 2004-2007 Internet Systems Consortium. All rights reserved.\n";
+"$Id: dhcp.c,v 1.192.2.71 2008/01/22 17:19:30 dhankins Exp $ Copyright (c) 2004-2007 Internet Systems Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
@@ -2471,9 +2471,6 @@ void ack_lease (packet, lease, offer, when, msg, ms_nulltp, hp)
putULong(state->expiry, (u_int32_t)offered_lease_time);
i = DHO_DHCP_LEASE_TIME;
- if (lookup_option (&dhcp_universe, state -> options, i))
- log_error ("dhcp-lease-time option for %s overridden.",
- inet_ntoa (state -> ciaddr));
oc = (struct option_cache *)0;
if (option_cache_allocate (&oc, MDL)) {
if (make_const_data(&oc->expression, state->expiry,
@@ -2489,9 +2486,6 @@ void ack_lease (packet, lease, offer, when, msg, ms_nulltp, hp)
offered_lease_time /= 2;
putULong(state->renewal, (u_int32_t)offered_lease_time);
i = DHO_DHCP_RENEWAL_TIME;
- if (lookup_option (&dhcp_universe, state -> options, i))
- log_error ("overriding dhcp-renewal-time for %s.",
- inet_ntoa (state -> ciaddr));
oc = (struct option_cache *)0;
if (option_cache_allocate (&oc, MDL)) {
if (make_const_data(&oc->expression, state->renewal,
@@ -2508,9 +2502,6 @@ void ack_lease (packet, lease, offer, when, msg, ms_nulltp, hp)
+ offered_lease_time / 4);
putULong(state->rebind, (u_int32_t)offered_lease_time);
i = DHO_DHCP_REBINDING_TIME;
- if (lookup_option (&dhcp_universe, state -> options, i))
- log_error ("overriding dhcp-rebinding-time for %s.",
- inet_ntoa (state -> ciaddr));
oc = (struct option_cache *)0;
if (option_cache_allocate (&oc, MDL)) {
if (make_const_data(&oc->expression, state->rebind,