]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
Reverting commit 22228 (cache-threshold) that is for 4.3 only.
authorTomek Mrugalski <tomek@isc.org>
Fri, 20 May 2011 14:21:11 +0000 (14:21 +0000)
committerTomek Mrugalski <tomek@isc.org>
Fri, 20 May 2011 14:21:11 +0000 (14:21 +0000)
RELNOTES
includes/dhcpd.h
server/dhcp.c
server/dhcpd.conf.5
server/stables.c

index 0c98d9dcc14b9faef148b7c40d574e9f0139f436..00388411cf5a05afcd3a0353519d38131d734f59 100644 (file)
--- a/RELNOTES
+++ b/RELNOTES
@@ -132,13 +132,6 @@ work on other platforms. Please report any problems and suggested fixes to
 
 - Compilation problem with gcc4.5 and omshell.c resolved. [ISC-Bugs #23831]
 
-- If a client renews before 'dhcp-cache-threshold' percent of its lease
-  has elapsed (default 25%), the server will reuse the allocated lease
-  (provide a lease within the currently allocated lease-time) rather
-  than extend or renew the lease.  This absolves the server of needing
-  to perform an fsync() operation on the lease database before reply,
-  which improves performance. [ISC-Bugs #22228]
-
 - Client Script fixes
   [ISC-Bugs #23045] Typos in client/scripts/openbsd
   [ISC-Bugs #23565] In the client scripts add a zone id (interface id) if
@@ -175,6 +168,7 @@ work on other platforms. Please report any problems and suggested fixes to
 - Modify the dlpi code to accept getmsg() returning a positive value.
   [ISC-Bugs #22824]
 
+
                        Changes since 4.2.0
 
 - 'get-host-names true;' now also works even if 'use-host-decl-names true;'
index 29aa1e9fef1f95a2dafd353d86877aa922fe1859..76e8a1b17b71a81ace7d607445fe731ec0f998df 100644 (file)
@@ -713,7 +713,6 @@ struct lease_state {
 # define SV_LDAP_TLS_RANDFILE           77
 #endif
 #endif
-#define SV_CACHE_THRESHOLD             78
 
 #if !defined (DEFAULT_PING_TIMEOUT)
 # define DEFAULT_PING_TIMEOUT 1
@@ -735,8 +734,27 @@ struct lease_state {
 # define DEFAULT_MIN_ACK_DELAY_USECS 10000 /* 1/100 second */
 #endif
 
-#if !defined (DEFAULT_CACHE_THRESHOLD)
-# define DEFAULT_CACHE_THRESHOLD 25
+#if defined(LDAP_CONFIGURATION)
+# define SV_LDAP_SERVER                        60
+# define SV_LDAP_PORT                  61
+# define SV_LDAP_USERNAME              62
+# define SV_LDAP_PASSWORD              63
+# define SV_LDAP_BASE_DN               64
+# define SV_LDAP_METHOD                        65
+# define SV_LDAP_DEBUG_FILE            66
+# define SV_LDAP_DHCP_SERVER_CN                67
+# define SV_LDAP_REFERRALS             68
+#if defined (LDAP_USE_SSL)
+# define SV_LDAP_SSL                   69
+# define SV_LDAP_TLS_REQCERT           70
+# define SV_LDAP_TLS_CA_FILE           71
+# define SV_LDAP_TLS_CA_DIR            72
+# define SV_LDAP_TLS_CERT              73
+# define SV_LDAP_TLS_KEY               74
+# define SV_LDAP_TLS_CRLCHECK          75
+# define SV_LDAP_TLS_CIPHERS           76
+# define SV_LDAP_TLS_RANDFILE          77
+#endif
 #endif
 
 #if !defined (DEFAULT_DEFAULT_LEASE_TIME)
index 7dcbab0c899e2214fe34a7b7c6b4b03d20d22d8b..49a5ec48487ee3aa1c95c51ac315641da5996050 100644 (file)
@@ -1505,7 +1505,6 @@ void ack_lease (packet, lease, offer, when, msg, ms_nulltp, hp)
 #if defined(DELAYED_ACK)
        isc_boolean_t enqueue = ISC_TRUE;
 #endif
-       int use_old_lease = 0;
 
        unsigned i, j;
        int s1;
@@ -2449,46 +2448,6 @@ void ack_lease (packet, lease, offer, when, msg, ms_nulltp, hp)
                        packet -> raw -> chaddr,
                        sizeof packet -> raw -> chaddr); /* XXX */
        } else {
-               int commit = (!offer || (offer == DHCPACK));
-               int thresh = DEFAULT_CACHE_THRESHOLD;
-
-               /*
-                * Check if the lease was issued recently, if so replay the 
-                * current lease and do not require a database sync event.  
-                * Recently is defined as being issued less than a given 
-                * percentage of the lease previously. The percentage can be 
-                * chosen either from a default value or via configuration.
-                *
-                */
-               if ((oc = lookup_option(&server_universe, state->options,
-                                       SV_CACHE_THRESHOLD)) &&
-                   evaluate_option_cache(&d1, packet, lt, NULL,
-                                         packet->options, state->options,
-                                         &lt->scope, oc, MDL)) {
-                       if (d1.len == 1 && (d1.data[0] < 100))
-                               thresh = d1.data[0];
-
-                       data_string_forget(&d1, MDL);
-               }
-
-               if ((thresh > 0) && (offer == DHCPACK) &&
-                   (lease->binding_state == FTS_ACTIVE)) {
-                       int limit;
-                       int prev_lease = lease->ends - lease->starts;
-
-                       /* it is better to avoid division by 0 */
-                       if (prev_lease <= (INT_MAX / thresh))
-                               limit = prev_lease * thresh / 100;
-                       else
-                               limit = prev_lease / 100 * thresh;
-
-                       if ((lt->starts - lease->starts) <= limit) {
-                               lt->starts = lease->starts;
-                               state->offered_expiry = lt->ends = lease->ends;
-                               commit = 0;
-                               use_old_lease = 1;
-                       }
-               }
 
 #if !defined(DELAYED_ACK)
                /* Install the new information on 'lt' onto the lease at
@@ -2499,19 +2458,9 @@ void ack_lease (packet, lease, offer, when, msg, ms_nulltp, hp)
                 * the same lease to another client later, and that would be
                 * a conflict.
                 */
-               if (!use_old_lease && !supersede_lease(lease, lt, commit,
+               if (!supersede_lease(lease, lt, !offer || (offer == DHCPACK),
                                     offer == DHCPACK, offer == DHCPACK)) {
 #else /* defined(DELAYED_ACK) */
-               /*
-                * If there already isn't a need for a lease commit, and we
-                * can just answer right away, set a flag to indicate this.
-                */
-               if (commit && !(lease->flags & STATIC_LEASE) &&
-                   (!offer || (offer == DHCPACK)))
-                       enqueue = ISC_TRUE;
-               else
-                       enqueue = ISC_FALSE;
-
                /* Install the new information on 'lt' onto the lease at
                 * 'lease'.  We will not 'commit' this information to disk
                 * yet (fsync()), we will 'propogate' the information if
@@ -2920,7 +2869,8 @@ void ack_lease (packet, lease, offer, when, msg, ms_nulltp, hp)
        } else {
                lease->cltt = cur_time;
 #if defined(DELAYED_ACK)
-               if (enqueue)
+               if (!(lease->flags & STATIC_LEASE) &&
+                   (!offer || (offer == DHCPACK)))
                        delayed_ack_enqueue(lease);
                else 
 #endif
index f6004c991b521439b7899c27e1e58cbfa7edb4e8..e642405bcaf3ae47a87b980924a61e6612f032a9 100644 (file)
@@ -27,7 +27,7 @@
 .\" Support and other services are available for ISC products - see
 .\" https://www.isc.org for more information or to learn more about ISC.
 .\"
-.\" $Id: dhcpd.conf.5,v 1.106.18.4 2011/05/12 14:01:15 tomasz Exp $
+.\" $Id: dhcpd.conf.5,v 1.106.18.5 2011/05/20 14:21:11 tomasz Exp $
 .\"
 .TH dhcpd.conf 5
 .SH NAME
@@ -2158,30 +2158,6 @@ feature is not compiled in by default, but must be enabled at compile time
 with \'./configure --enable-delayed-ack\'.
 .RE
 .PP
-The 
-.I dhcp-cache-threshold 
-statement
-.RS 0.25i
-.PP
-.B dhcp-cache-threshold \fIpercentage\fB;\fR
-.PP
-The \fIdhcp-cache-threshold\fR statement takes one integer parameter
-with allowed values between 0 and 100. The default value is 25 (25% of
-the lease time). This parameter expresses the percentage of the total
-lease time, measured from the beginning, during which a
-client's attempt to renew its lease will result in getting
-the already assigned lease, rather than an extended lease.
-.PP
-Clients that attempt renewal frequently can cause the server to
-update and write the database frequently resulting in a performance
-impact on the server.  The \fIdhcp-cache-threshold\fR
-statement instructs the DHCP server to avoid updating leases too
-frequently thus avoiding this behavior.  Instead the server assigns the
-same lease with no modifications except for CLTT (Client Last
-Transmission Time) which does not require disk operations. This
-feature applies to IPv4 only.
-.RE
-.PP
 The
 .I do-forward-updates
 statement
index a8e499890830d4733bab7c7e32170e93811ae9e8..82945277475144446769d428ff5a57bb481b9ff5 100644 (file)
@@ -266,7 +266,6 @@ static struct option server_options[] = {
        { "ldap-tls-randfile", "t",             &server_universe,  77, 1 },
 #endif /* LDAP_USE_SSL */
 #endif /* LDAP_CONFIGURATION */
-       { "dhcp-cache-threshold", "B",          &server_universe,  78, 1 },
        { NULL, NULL, NULL, 0, 0 }
 };