Parcourir la source

[master] Initialized more variables in D2ClientConfigParser::parse

Francis Dupont il y a 8 ans
Parent
commit
3ddfc47f12
2 fichiers modifiés avec 8 ajouts et 7 suppressions
  1. 1 1
      src/lib/dhcpsrv/d2_client_cfg.h
  2. 7 6
      src/lib/dhcpsrv/parsers/dhcp_parsers.cc

+ 1 - 1
src/lib/dhcpsrv/d2_client_cfg.h

@@ -254,7 +254,7 @@ private:
     /// @brief IP port on which the client should send
     size_t sender_port_;
 
-    /// @brief Maxium number of NCRs allowed to queue waiting to send
+    /// @brief Maximum number of NCRs allowed to queue waiting to send
     size_t max_queue_size_;
 
     /// @brief The socket protocol to use with kea-dhcp-ddns.

+ 7 - 6
src/lib/dhcpsrv/parsers/dhcp_parsers.cc

@@ -1315,17 +1315,18 @@ D2ClientConfigParser::parse(isc::data::ConstElementPtr client_config) {
     std::string qualifying_suffix;
     bool found_qualifying_suffix = false;
     IOAddress server_ip(0);
-    uint32_t server_port;
+    uint32_t server_port = 0;
     std::string sender_ip_str;
     uint32_t sender_port;
-    uint32_t max_queue_size;
+    uint32_t max_queue_size = 1024;
     dhcp_ddns::NameChangeProtocol ncr_protocol;
     dhcp_ddns::NameChangeFormat ncr_format;
-    bool always_include_fqdn;
+    bool always_include_fqdn = false;
     bool allow_client_update;
-    bool override_no_update;
-    bool override_client_update;
-    D2ClientConfig::ReplaceClientNameMode replace_client_name_mode;
+    bool override_no_update = false;
+    bool override_client_update = false;
+    D2ClientConfig::ReplaceClientNameMode replace_client_name_mode =
+        D2ClientConfig::ReplaceClientNameMode::RCM_NEVER;
     std::string generated_prefix;
 
     BOOST_FOREACH(ConfigPair param, client_config->mapValue()) {