|
41 | 41 | #include <dhcpsrv/parsers/shared_networks_list_parser.h>
|
42 | 42 | #include <dhcpsrv/parsers/sanity_checks_parser.h>
|
43 | 43 | #include <dhcpsrv/host_data_source_factory.h>
|
| 44 | +#include <dhcpsrv/host_mgr.h> |
44 | 45 | #include <dhcpsrv/pool.h>
|
45 | 46 | #include <dhcpsrv/subnet.h>
|
46 | 47 | #include <dhcpsrv/timer_mgr.h>
|
@@ -884,43 +885,22 @@ configureDhcp6Server(Dhcpv6Srv& server, isc::data::ConstElementPtr config_set,
|
884 | 885 | if (status_code == CONTROL_RESULT_SUCCESS) {
|
885 | 886 | if (check_only) {
|
886 | 887 | if (extra_checks) {
|
887 |
| - // Re-open lease and host database with new parameters. |
| 888 | + std::ostringstream err; |
| 889 | + // Configure DHCP packet queueing |
888 | 890 | try {
|
889 |
| - // Get the staging configuration. |
890 |
| - srv_config = CfgMgr::instance().getStagingCfg(); |
891 |
| - |
892 |
| - CfgDbAccessPtr cfg_db = CfgMgr::instance().getStagingCfg()->getCfgDbAccess(); |
893 |
| - string params = "universe=6 persist=false"; |
894 |
| - // The "extended-info-tables" has no effect on -T command |
895 |
| - // line parameter so it is omitted on purpose. |
896 |
| - // Note that in this case, the current code creates managers |
897 |
| - // before hooks are loaded, so it can not be activated by |
898 |
| - // the BLQ hook. |
899 |
| - cfg_db->setAppendedParameters(params); |
900 |
| - cfg_db->createManagers(); |
| 891 | + data::ConstElementPtr qc; |
| 892 | + qc = CfgMgr::instance().getStagingCfg()->getDHCPQueueControl(); |
| 893 | + if (IfaceMgr::instance().configureDHCPPacketQueue(AF_INET6, qc)) { |
| 894 | + LOG_INFO(dhcp6_logger, DHCP6_CONFIG_PACKET_QUEUE) |
| 895 | + .arg(IfaceMgr::instance().getPacketQueue6()->getInfoStr()); |
| 896 | + } |
| 897 | + |
901 | 898 | } catch (const std::exception& ex) {
|
902 |
| - answer = isc::config::createAnswer(CONTROL_RESULT_ERROR, ex.what()); |
| 899 | + err << "Error setting packet queue controls after server reconfiguration: " |
| 900 | + << ex.what(); |
| 901 | + answer = isc::config::createAnswer(CONTROL_RESULT_ERROR, err.str()); |
903 | 902 | status_code = CONTROL_RESULT_ERROR;
|
904 | 903 | }
|
905 |
| - |
906 |
| - if (status_code == CONTROL_RESULT_SUCCESS) { |
907 |
| - std::ostringstream err; |
908 |
| - // Configure DHCP packet queueing |
909 |
| - try { |
910 |
| - data::ConstElementPtr qc; |
911 |
| - qc = CfgMgr::instance().getStagingCfg()->getDHCPQueueControl(); |
912 |
| - if (IfaceMgr::instance().configureDHCPPacketQueue(AF_INET6, qc)) { |
913 |
| - LOG_INFO(dhcp6_logger, DHCP6_CONFIG_PACKET_QUEUE) |
914 |
| - .arg(IfaceMgr::instance().getPacketQueue6()->getInfoStr()); |
915 |
| - } |
916 |
| - |
917 |
| - } catch (const std::exception& ex) { |
918 |
| - err << "Error setting packet queue controls after server reconfiguration: " |
919 |
| - << ex.what(); |
920 |
| - answer = isc::config::createAnswer(CONTROL_RESULT_ERROR, err.str()); |
921 |
| - status_code = CONTROL_RESULT_ERROR; |
922 |
| - } |
923 |
| - } |
924 | 904 | }
|
925 | 905 | } else {
|
926 | 906 | // disable multi-threading (it will be applied by new configuration)
|
@@ -1044,6 +1024,25 @@ configureDhcp6Server(Dhcpv6Srv& server, isc::data::ConstElementPtr config_set,
|
1044 | 1024 | " parsing error");
|
1045 | 1025 | status_code = CONTROL_RESULT_ERROR;
|
1046 | 1026 | }
|
| 1027 | + |
| 1028 | + if (extra_checks && status_code == CONTROL_RESULT_SUCCESS) { |
| 1029 | + // Re-open lease and host database with new parameters. |
| 1030 | + try { |
| 1031 | + // Get the staging configuration. |
| 1032 | + srv_config = CfgMgr::instance().getStagingCfg(); |
| 1033 | + |
| 1034 | + CfgDbAccessPtr cfg_db = CfgMgr::instance().getStagingCfg()->getCfgDbAccess(); |
| 1035 | + string params = "universe=6 persist=false"; |
| 1036 | + if (cfg_db->getExtendedInfoTablesEnabled()) { |
| 1037 | + params += " extended-info-tables=true"; |
| 1038 | + } |
| 1039 | + cfg_db->setAppendedParameters(params); |
| 1040 | + cfg_db->createManagers(); |
| 1041 | + } catch (const std::exception& ex) { |
| 1042 | + answer = isc::config::createAnswer(CONTROL_RESULT_ERROR, ex.what()); |
| 1043 | + status_code = CONTROL_RESULT_ERROR; |
| 1044 | + } |
| 1045 | + } |
1047 | 1046 | }
|
1048 | 1047 |
|
1049 | 1048 | // Log the list of known backends.
|
|
0 commit comments