bool packet_park = false;
- if (ctx.committed_ &&
+ if (!ctx.fake_allocation_ && (ctx.query_->getType() != DHCPV6_CONFIRM) &&
+ (ctx.query_->getType() != DHCPV6_INFORMATION_REQUEST) &&
HooksManager::calloutsPresent(Hooks.hook_index_leases6_committed_)) {
CalloutHandlePtr callout_handle = getCalloutHandle(query);
return (ia_rsp);
}
- // "Fake" allocation is the case when the server is processing the Solicit
- // message without the Rapid Commit option and advertises a lease to
- // the client, but doesn't commit this lease to the lease database. If
- // the Solicit contains the Rapid Commit option and the server is
- // configured to honor the Rapid Commit option, or the client has sent
- // the Request message, the lease will be committed to the lease
- // database. The type of the server's response may be used to determine
- // if this is the fake allocation case or not. When the server sends
- // Reply message it means that it is committing leases. Other message
- // type (Advertise) means that server is not committing leases (fake
- // allocation).
- bool fake_allocation = (answer->getType() != DHCPV6_REPLY);
-
// Get DDNS update direction flags
bool do_fwd = false;
bool do_rev = false;
// Update per-packet context values.
ctx.fwd_dns_update_ = do_fwd;
ctx.rev_dns_update_ = do_rev;
- ctx.fake_allocation_ = fake_allocation;
// Set per-IA context values.
ctx.createIAContext();
if (lease) {
// We have a lease! Let's wrap its content into IA_NA option
// with IAADDR suboption.
- LOG_INFO(lease6_logger, fake_allocation ? DHCP6_LEASE_ADVERT : DHCP6_LEASE_ALLOC)
+ LOG_INFO(lease6_logger, ctx.fake_allocation_ ? DHCP6_LEASE_ADVERT : DHCP6_LEASE_ALLOC)
.arg(query->getLabel())
.arg(lease->addr_.toText())
.arg(ia->getIAID());
// cause of that failure. The only thing left is to insert
// status code to pass the sad news to the client.
- LOG_DEBUG(lease6_logger, DBG_DHCP6_DETAIL, fake_allocation ?
+ LOG_DEBUG(lease6_logger, DBG_DHCP6_DETAIL, ctx.fake_allocation_ ?
DHCP6_LEASE_ADVERT_FAIL : DHCP6_LEASE_ALLOC_FAIL)
.arg(query->getLabel())
.arg(ia->getIAID());
return (ia_rsp);
}
- // "Fake" allocation is the case when the server is processing the Solicit
- // message without the Rapid Commit option and advertises a lease to
- // the client, but doesn't commit this lease to the lease database. If
- // the Solicit contains the Rapid Commit option and the server is
- // configured to honor the Rapid Commit option, or the client has sent
- // the Request message, the lease will be committed to the lease
- // database. The type of the server's response may be used to determine
- // if this is the fake allocation case or not. When the server sends
- // Reply message it means that it is committing leases. Other message
- // type (Advertise) means that server is not committing leases (fake
- // allocation).
- ctx.fake_allocation_ = (answer->getType() != DHCPV6_REPLY);
-
// Set per-IA context values.
ctx.createIAContext();
ctx.currentIA().iaid_ = ia->getIAID();
}
}
+ // "Fake" allocation is the case when the server is processing the Solicit
+ // message without the Rapid Commit option and advertises a lease to
+ // the client, but doesn't commit this lease to the lease database. If
+ // the Solicit contains the Rapid Commit option and the server is
+ // configured to honor the Rapid Commit option, or the client has sent
+ // the Request message, the lease will be committed to the lease
+ // database. The type of the server's response may be used to determine
+ // if this is the fake allocation case or not. When the server sends
+ // Reply message it means that it is committing leases. Other message
+ // type (Advertise) means that server is not committing leases (fake
+ // allocation).
+ ctx.fake_allocation_ = (response->getType() != DHCPV6_REPLY);
+
processClientFqdn(solicit, response, ctx);
assignLeases(solicit, response, ctx);
generateFqdn(reply);
createNameChangeRequests(reply, ctx);
- ctx.committed_ = true;
-
return (reply);
}
generateFqdn(reply);
createNameChangeRequests(reply, ctx);
- ctx.committed_ = true;
-
return (reply);
}
generateFqdn(reply);
createNameChangeRequests(reply, ctx);
- ctx.committed_ = true;
-
return (reply);
}
/// @todo If client sent a release and we should remove outstanding
/// DNS records.
- ctx.committed_ = true;
-
return (reply);
}
appendDefaultOptions(decline, reply, co_list);
if (declineLeases(decline, reply, ctx)) {
- ctx.committed_ = true;
return (reply);
} else {
AllocEngine::ClientContext6::ClientContext6()
: query_(), fake_allocation_(false), subnet_(), host_subnet_(), duid_(),
hwaddr_(), host_identifiers_(), hosts_(), fwd_dns_update_(false),
- rev_dns_update_(false), committed_(false), hostname_(),
- callout_handle_(), ias_() {
+ rev_dns_update_(false), hostname_(), callout_handle_(), ias_() {
}
AllocEngine::ClientContext6::ClientContext6(const Subnet6Ptr& subnet,
const CalloutHandlePtr& callout_handle)
: query_(query), fake_allocation_(fake_allocation), subnet_(subnet),
duid_(duid), hwaddr_(), host_identifiers_(), hosts_(),
- fwd_dns_update_(fwd_dns), rev_dns_update_(rev_dns), committed_(false),
- hostname_(hostname), callout_handle_(callout_handle),
- allocated_resources_(), new_leases_(), deleted_leases_(), ias_() {
+ fwd_dns_update_(fwd_dns), rev_dns_update_(rev_dns), hostname_(hostname),
+ callout_handle_(callout_handle), allocated_resources_(), new_leases_(),
+ deleted_leases_(), ias_() {
// Initialize host identifiers.
if (duid) {