]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
- Delayed-ack is now a compile-time option, compiled out by default.
authorDavid Hankins <dhankins@isc.org>
Mon, 3 Nov 2008 18:13:58 +0000 (18:13 +0000)
committerDavid Hankins <dhankins@isc.org>
Mon, 3 Nov 2008 18:13:58 +0000 (18:13 +0000)
  This feature is simply too experimental for right now, and causes
  some problems to some failover installations.  We will revisit this
  in future releases.  [ISC-Bugs #18832]

RELNOTES
configure.ac
server/dhcp.c
server/dhcpd.conf.5
server/stables.c

index 64cfb2a119443f7f471fdc28778f74018bcb99ff..b8781fb363f11e1a0f3dd6576abc3fa0c192a9ed 100644 (file)
--- a/RELNOTES
+++ b/RELNOTES
@@ -67,6 +67,11 @@ work on other platforms. Please report any problems and suggested fixes to
 
 - A bug cleaning up unknown-xxx temporary option definitions was fixed.
 
+- Delayed-ack is now a compile-time option, compiled out by default.
+  This feature is simply too experimental for right now, and causes
+  some problems to some failover installations.  We will revisit this
+  in future releases.
+
                        Changes since 4.1.0a1
 
 - Corrected list of failover state values in dhcpd man page.
index 9df3c2b15b8470fb44894af5601680e562f174ca..063232d82724e1f0ad5f9d78a6ba79bd57e1e067 100644 (file)
@@ -91,6 +91,15 @@ if test "$enable_tracing" != "no" ; then
                  [Define to include server activity tracing support.])
 fi
 
+# Delayed-ack feature support (experimental).
+AC_ARG_ENABLE(delayed_ack,
+       AC_HELP_STRING([--enable-delayed-ack],
+                      [queues multiple DHCPACK replies (default is no)]))
+if test "$enable_delayed_ack" = "yes"; then
+       AC_DEFINE([DELAYED_ACK], [1],
+                 [Define to queue multiple DHCPACK replies per fsync.])
+fi
+
 # DHCPv6 optional compile-time feature.
 AC_ARG_ENABLE(dhcpv6,
        AC_HELP_STRING([--enable-dhcpv6],
index d26fc0002ae47a4b86ca8de97506aeacb18d44fe..ec1c2ef19d018c94e05b5ca3b100b47c3200a222 100644 (file)
@@ -2424,15 +2424,30 @@ void ack_lease (packet, lease, offer, when, msg, ms_nulltp, hp)
                        packet -> raw -> chaddr,
                        sizeof packet -> raw -> chaddr); /* XXX */
        } else {
+#if !defined(DELAYED_ACK)
                /* 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
-               * this is BOOTP or a DHCPACK, but we will not 'pimmediate'ly
-               * transmit failover binding updates (this is delayed until
-               * after the fsync()).
-               */
+                * 'lease'.  If this is a DHCPOFFER, it is a 'soft' promise,
+                * if it is a DHCPACK, it is a 'hard' binding, so it needs
+                * to be recorded and propogated immediately.  If the update
+                * fails, don't ACK it (or BOOTREPLY) either; we may give
+                * the same lease to another client later, and that would be
+                * a conflict.
+                */
+               if (!supersede_lease(lease, lt, !offer || (offer == DHCPACK),
+                                    offer == DHCPACK, offer == DHCPACK)) {
+#else /* defined(DELAYED_ACK) */
+               /* 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
+                * this is BOOTP or a DHCPACK, but we will not 'pimmediate'ly
+                * transmit failover binding updates (this is delayed until
+                * after the fsync()).  If the update fails, don't ACK it (or
+                * BOOTREPLY either); we may give the same lease out to a
+                * different client, and that would be a conflict.
+                */
                if (!supersede_lease(lease, lt, 0, !offer || offer == DHCPACK,
                                     0)) {
+#endif
                        log_info ("%s: database update failed", msg);
                        free_lease_state (state, MDL);
                        lease_dereference (&lt, MDL);
@@ -2822,10 +2837,12 @@ void ack_lease (packet, lease, offer, when, msg, ms_nulltp, hp)
                ++outstanding_pings;
        } else {
                lease->cltt = cur_time;
+#if defined(DELAYED_ACK)
                if (!(lease->flags & STATIC_LEASE) &&
                    (!offer || (offer == DHCPACK)))
                        delayed_ack_enqueue(lease);
                else 
+#endif
                        dhcp_reply(lease);
        }
 }
index 238b8d7429ef72f1ea22fa9df559fb7c468de249..4615227b36bb468734e66448c9bbeb52acd2d432 100644 (file)
@@ -28,7 +28,7 @@
 .\" see ``http://www.vix.com''.   To learn more about Nominum, Inc., see
 .\" ``http://www.nominum.com''.
 .\"
-.\" $Id: dhcpd.conf.5,v 1.98 2008/10/22 11:41:58 fdupont Exp $
+.\" $Id: dhcpd.conf.5,v 1.99 2008/11/03 18:13:58 dhankins Exp $
 .\"
 .TH dhcpd.conf 5
 .SH NAME
@@ -2098,6 +2098,10 @@ Similarly, \fImicroseconds\fR indicates how many microseconds are permitted
 to pass inbetween queuing a packet pending an fsync, and performing the
 fsync.  Valid values range from 0 to 2^32-1, and defaults to 250,000 (1/4 of
 a second).
+.PP
+Please note that as delayed-ack is currently experimental, the delayed-ack
+feature is not compiled in by default, but must be enabled at compile time
+with './configure --enable-delayed-ack'.
 .RE
 .PP
 The
index d21181662746db653e395f120c685eef5da082e2..c4215baa7a54f62eead83f50998c7fd4dffaa1af 100644 (file)
@@ -239,8 +239,11 @@ static struct option server_options[] = {
        { "dhcpv6-pid-file-name", "t",          &server_universe,  55, 1 },
        { "limit-addrs-per-ia", "L",            &server_universe,  56, 1 },
        { "limit-prefs-per-ia", "L",            &server_universe,  57, 1 },
+/* Assert a configuration parsing error if delayed-ack isn't compiled in. */
+#if defined(DELAYED_ACK)
        { "delayed-ack", "S",                   &server_universe,  58, 1 },
        { "max-ack-delay", "L",                 &server_universe,  59, 1 },
+#endif
        { NULL, NULL, NULL, 0, 0 }
 };