try {
Dhcp4to6Ipc::instance().open();
} catch (const std::exception& ex) {
- std::ostringstream err;
err << "error starting DHCPv4-over-DHCPv6 IPC "
" after server reconfiguration: " << ex.what();
return (isc::config::createAnswer(1, err.str()));
HooksManager::callCallouts(Hooks.hooks_index_dhcp4_srv_configured_,
*callout_handle);
- // Ignore status code as none of them would have an effect on further
- // operation.
+ // If next step is DROP, report a configuration error.
+ if (callout_handle->getStatus() == CalloutHandle::NEXT_STEP_DROP) {
+ string error;
+ try {
+ callout_handle->getArgument("error", error);
+ } catch (NoSuchArgument const& ex) {
+ error = "unknown error";
+ }
+ return (isc::config::createAnswer(CONTROL_RESULT_ERROR, error));
+ }
}
// Apply multi threading settings.
provides access to the DHCP service state of the server and allows for
enabling and disabling the DHCP service from the hooks libraries.
- - <b>Next step status</b>: Status codes returned by the callouts installed on
- this hook point are ignored.
+ - <b>Next step status</b>: If any callout sets the status to DROP, the server
+ will interrupt the reconfiguration process. The hook callout is expected to
+ have completed the cause of the interruption under the "error" handle argument
+ with a std::string which is then logged. Finally, this leads to the
+ termination of kea-dhcp4.
@subsection dhcpv4HooksCb4Update cb4_updated
- @b Arguments:
}
} catch (const std::exception& ex) {
- std::ostringstream err;
err << "unable to configure server identifier: " << ex.what();
return (isc::config::createAnswer(1, err.str()));
}
try {
Dhcp6to4Ipc::instance().open();
} catch (const std::exception& ex) {
- std::ostringstream err;
err << "error starting DHCPv4-over-DHCPv6 IPC "
" after server reconfiguration: " << ex.what();
return (isc::config::createAnswer(1, err.str()));
HooksManager::callCallouts(Hooks.hooks_index_dhcp6_srv_configured_,
*callout_handle);
- // Ignore status code as none of them would have an effect on further
- // operation.
+ // If next step is DROP, report a configuration error.
+ if (callout_handle->getStatus() == CalloutHandle::NEXT_STEP_DROP) {
+ string error;
+ try {
+ callout_handle->getArgument("error", error);
+ } catch (NoSuchArgument const& ex) {
+ error = "unknown error";
+ }
+ return (isc::config::createAnswer(CONTROL_RESULT_ERROR, error));
+ }
}
// Apply multi threading settings.
provides access to the DHCP service state of the server and allows for
enabling and disabling the DHCP service from the hooks libraries.
- - <b>Next step status</b>: Status codes returned by the callouts installed on
- this hook point are ignored.
+
+ - <b>Next step status</b>: If any callout sets the status to DROP, the server
+ will interrupt the reconfiguration process. The hook callout is expected to
+ have completed the cause of the interruption under the "error" handle argument
+ with a std::string which is then logged. Finally, this leads to the
+ termination of kea-dhcp6.
@subsection dhcpv6HooksCb6Update cb6_updated
- @b Arguments: