Moved responsibility from hook lib to servers. This makes the hook
point more uniformly usable to custom hook developers
src/bin/dhcp4/dhcp4_srv.cc
Dhcpv4Srv::processClientName() - update the FQDN option
in response as part of ddns4_update hook point logic
src/bin/dhcp6/dhcp6_srv.cc
Dhcpv6Srv::processClientFqdn() - update the FQDN option
in response as part of ddns6_update hook point logic
}
}
-
// Optionally, call a hook that may possibly override the decisions made
// earlier.
if (HooksManager::calloutsPresent(Hooks.hook_index_ddns4_update_)) {
hostname = hook_hostname;
fqdn_fwd = hook_fqdn_fwd;
fqdn_rev = hook_fqdn_rev;
+
+ // If there's an outbound FQDN option in the response we need
+ // to update it with the new host name.
+ Option4ClientFqdnPtr fqdn = boost::dynamic_pointer_cast<Option4ClientFqdn>
+ (resp->getOption(DHO_FQDN));
+ if (fqdn) {
+ fqdn->setDomainName(hook_hostname, Option4ClientFqdn::FULL);
+ }
}
}
LOG_DEBUG(hooks_logger, DBGLVL_PKT_HANDLING, DHCP6_HOOK_DDNS_UPDATE)
.arg(ctx.hostname_).arg(hook_hostname).arg(ctx.fwd_dns_update_).arg(hook_fwd_dns_update)
.arg(ctx.rev_dns_update_).arg(hook_rev_dns_update);
+
+ // Update the FQDN option in the response.
+ fqdn_resp = boost::dynamic_pointer_cast<Option6ClientFqdn>(question->getOption(D6O_CLIENT_FQDN));
+ if (fqdn) {
+ fqdn_resp->setDomainName(hook_hostname, Option6ClientFqdn::FULL);
+ }
+
ctx.hostname_ = hook_hostname;
ctx.fwd_dns_update_ = hook_fwd_dns_update;
ctx.rev_dns_update_ = hook_rev_dns_update;
}
}
-
}
void