BIND 10 trac2850_3, updated. 6de9f8bf01a42ec823e9db70b42ffa301c4a928f [2850] Check the case where READ_WRITE mode doesn't find a checksum in an existing segment
BIND 10 source code commits
bind10-changes at lists.isc.org
Wed May 15 14:35:39 UTC 2013
The branch, trac2850_3 has been updated
via 6de9f8bf01a42ec823e9db70b42ffa301c4a928f (commit)
from 465a926d11f043b79483f00bafb77b0926c1cb6b (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 6de9f8bf01a42ec823e9db70b42ffa301c4a928f
Author: Mukund Sivaraman <muks at isc.org>
Date: Wed May 15 20:03:51 2013 +0530
[2850] Check the case where READ_WRITE mode doesn't find a checksum in an existing segment
Note that it's not possible to repeat a similar test for the
ZoneTableHeader name as there are additional allocations by then.
-----------------------------------------------------------------------
Summary of changes:
.../datasrc/memory/zone_table_segment_mapped.cc | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
-----------------------------------------------------------------------
diff --git a/src/lib/datasrc/memory/zone_table_segment_mapped.cc b/src/lib/datasrc/memory/zone_table_segment_mapped.cc
index efadab7..d2830fc 100644
--- a/src/lib/datasrc/memory/zone_table_segment_mapped.cc
+++ b/src/lib/datasrc/memory/zone_table_segment_mapped.cc
@@ -80,6 +80,14 @@ ZoneTableSegmentMapped::processChecksum(MemorySegmentMapped& segment,
}
}
} else {
+ if ((!create) && (!segment.allMemoryDeallocated())) {
+ // If we are resetting in READ_WRITE mode, and some memory
+ // was already allocated but there is no checksum, that
+ // indicates that the segment is corrupted.
+ error_msg = "Existing segment is missing a checksum name";
+ return (false);
+ }
+
// Allocate space for a checksum (which is saved during close).
void* checksum = NULL;
while (!checksum) {
@@ -105,7 +113,7 @@ ZoneTableSegmentMapped::processHeader(MemorySegmentMapped& segment,
segment.getNamedAddress(ZONE_TABLE_HEADER_NAME);
if (result.first) {
if (create) {
- // There must be no previously saved checksum.
+ // There must be no previously saved header.
error_msg = "There is already a saved ZoneTableHeader in the "
"segment opened in create mode";
return (false);
More information about the bind10-changes
mailing list