diff --git a/RELNOTES b/RELNOTES index 64cfb2a1..b8781fb3 100644 --- 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. diff --git a/configure.ac b/configure.ac index 9df3c2b1..063232d8 100644 --- a/configure.ac +++ b/configure.ac @@ -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], diff --git a/server/dhcp.c b/server/dhcp.c index d26fc000..ec1c2ef1 100644 --- a/server/dhcp.c +++ b/server/dhcp.c @@ -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 (<, 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); } } diff --git a/server/dhcpd.conf.5 b/server/dhcpd.conf.5 index 238b8d74..4615227b 100644 --- a/server/dhcpd.conf.5 +++ b/server/dhcpd.conf.5 @@ -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 diff --git a/server/stables.c b/server/stables.c index d2118166..c4215baa 100644 --- a/server/stables.c +++ b/server/stables.c @@ -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 } };