Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 853055 Details for
Bug 1053431
dhcpd6.leases: file is too long to buffer
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Proposed patch
diff.patch (text/plain), 3.89 KB, created by
Jaromír Končický
on 2014-01-21 09:27:51 UTC
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Jaromír Končický
Created:
2014-01-21 09:27:51 UTC
Size:
3.89 KB
patch
obsolete
>diff -ruN 4.2.4rc1/dhcp-4.2.4rc1/includes/dhcpd.h 4.2.4rc2/dhcp-4.2.4rc2/includes/dhcpd.h >--- 4.2.4rc1/dhcp-4.2.4rc1/includes/dhcpd.h 2012-04-10 02:55:06.000000000 +0200 >+++ 4.2.4rc2/dhcp-4.2.4rc2/includes/dhcpd.h 2012-05-15 23:07:41.000000000 +0200 >@@ -2779,6 +2779,7 @@ > void commit_leases_timeout PROTO ((void *)); > void commit_leases_readerdry(void *); > int commit_leases PROTO ((void)); >+int commit_leases_timed (void); > void db_startup PROTO ((int)); > int new_lease_file PROTO ((void)); > int group_writer (struct group_object *); >diff -ruN 4.2.4rc1/dhcp-4.2.4rc1/server/db.c 4.2.4rc2/dhcp-4.2.4rc2/server/db.c >--- 4.2.4rc1/dhcp-4.2.4rc1/server/db.c 2012-03-09 12:28:12.000000000 +0100 >+++ 4.2.4rc2/dhcp-4.2.4rc2/server/db.c 2012-05-15 23:07:41.000000000 +0200 >@@ -36,6 +36,8 @@ > #include <ctype.h> > #include <errno.h> > >+#define LEASE_REWRITE_PERIOD 3600 >+ > static isc_result_t write_binding_scope(FILE *db_file, struct binding *bnd, > char *prepend); > >@@ -1002,7 +1004,7 @@ > /* If we haven't rewritten the lease database in over an > hour, rewrite it now. (The length of time should probably > be configurable. */ >- if (count && cur_time - write_time > 3600) { >+ if (count && cur_time - write_time > LEASE_REWRITE_PERIOD) { > count = 0; > write_time = cur_time; > new_lease_file (); >@@ -1010,6 +1012,21 @@ > return 1; > } > >+/* >+ * rewrite the lease file about once an hour >+ * This is meant as a quick patch for ticket 24887. It allows >+ * us to rotate the v6 lease file without adding too many fsync() >+ * calls. In the future wes should revisit this area and add >+ * something similar to the delayed ack code for v4. >+ */ >+int commit_leases_timed() >+{ >+ if ((count != 0) && (cur_time - write_time > LEASE_REWRITE_PERIOD)) { >+ return (commit_leases()); >+ } >+ return (1); >+} >+ > void db_startup (testp) > int testp; > { >diff -ruN 4.2.4rc1/dhcp-4.2.4rc1/server/dhcpv6.c 4.2.4rc2/dhcp-4.2.4rc2/server/dhcpv6.c >--- 4.2.4rc1/dhcp-4.2.4rc1/server/dhcpv6.c 2012-04-11 00:14:04.000000000 +0200 >+++ 4.2.4rc2/dhcp-4.2.4rc2/server/dhcpv6.c 2012-05-15 23:07:41.000000000 +0200 >@@ -1207,6 +1207,10 @@ > } > > /* >+ *! \file server/dhcpv6.c >+ * >+ * \brief construct a reply containing information about a client's lease >+ * > * lease_to_client() is called from several messages to construct a > * reply that contains all that we know about the client's correct lease > * (or projected lease). >@@ -1228,8 +1232,15 @@ > * validate and echo back any contents that can be. If the client-supplied > * data does not error out (on renew/rebind as above), but we did not send > * any addresses, attempt to allocate one. >+ * >+ * At the end of the this function we call commit_leases_timed() to >+ * fsync and rotate the file as necessary. commit_leases_timed() will >+ * check that we have written at least one lease to the file and that >+ * some time has passed before doing any fsync or file rewrite so we >+ * don't bother tracking if we did a write_ia during this function. > */ > /* TODO: look at client hints for lease times */ >+ > static void > lease_to_client(struct data_string *reply_ret, > struct packet *packet, >@@ -1493,6 +1504,9 @@ > memcpy(reply_ret->buffer->data, reply.buf.data, reply.cursor); > reply_ret->data = reply_ret->buffer->data; > >+ /* If appropriate commit and rotate the lease file */ >+ (void) commit_leases_timed(); >+ > exit: > /* Cleanup. */ > if (reply.shared != NULL) >diff -ruN 4.2.4rc1/dhcp-4.2.4rc1/server/mdb6.c 4.2.4rc2/dhcp-4.2.4rc2/server/mdb6.c >--- 4.2.4rc1/dhcp-4.2.4rc1/server/mdb6.c 2012-04-10 02:55:06.000000000 +0200 >+++ 4.2.4rc2/dhcp-4.2.4rc2/server/mdb6.c 2012-05-15 23:07:41.000000000 +0200 >@@ -1715,6 +1715,13 @@ > } > > /* >+ * If appropriate commit and rotate the lease file >+ * As commit_leases_timed() checks to see if we've done any writes >+ * we don't bother tracking if this function called write _ia >+ */ >+ (void) commit_leases_timed(); >+ >+ /* > * Do some cleanup of our expired leases. > */ > cleanup_old_expired(pool);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1053431
:
851160
| 853055