BIND 10 #2850: Define and implement ZoneTableSegmentMapped
BIND 10 Development
do-not-reply at isc.org
Thu May 9 04:04:48 UTC 2013
#2850: Define and implement ZoneTableSegmentMapped
-------------------------------------+-------------------------------------
Reporter: jinmei | Owner: muks
Type: task | Status:
Priority: medium | reviewing
Component: data source | Milestone:
Keywords: | Sprint-20130514
Sensitive: 0 | Resolution:
Sub-Project: DNS | CVSS Scoring:
Estimated Difficulty: 5 | Defect Severity: N/A
Total Hours: 0 | Feature Depending on Ticket:
| shared memory data source
| Add Hours to Ticket: 0
| Internal?: 0
-------------------------------------+-------------------------------------
Comment (by jinmei):
While reviewing #2836 I noticed one related thing: memory remapping
can happen in `ZoneWriter::load()` and `ZoneWriter::install()`,
which could invalidate the zone table header address (return value
of getHeader()).
So, we'll need something like this:
- add another virtual method to `ZoneTableSegment`:
{{{#!cpp
// update header_ by getting the address of ZONE_TABLE_HEADER_NAME
again.
// (local version can be nop.)
virtual void resetHeader() = 0;
}}}
- and update load() and install() as follows:
{{{#!cpp
void
ZoneWriter::load() {
if (state_ != ZW_UNUSED) {
isc_throw(isc::InvalidOperation, "Trying to load twice");
}
zone_data_ = load_action_(segment_.getMemorySegment());
if (!zone_data_) {
// Bug inside load_action_.
isc_throw(isc::InvalidOperation, "No data returned from load
action");
}
segment_.resetHeader();
state_ = ZW_LOADED;
}
void
ZoneWriter::install() {
if (state_ != ZW_LOADED) {
isc_throw(isc::InvalidOperation, "No data to install");
}
ZoneTable* table(segment_.getHeader().getTable());
if (!table) {
isc_throw(isc::Unexpected, "No zone table present");
}
const ZoneTable::AddResult result(table->addZone(
segment_.getMemorySegment(),
rrclass_, origin_, zone_data_));
state_ = ZW_INSTALLED;
zone_data_ = result.zone_data;
segment_.resetHeader();
}
}}}
If you think these are too much for this task, I'm okay with deferring
it to a separate ticket.
--
Ticket URL: <http://bind10.isc.org/ticket/2850#comment:19>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development
More information about the bind10-tickets
mailing list