]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[5126] Changes after review trac5126
authorTomek Mrugalski <tomasz@isc.org>
Tue, 25 Jul 2017 15:52:09 +0000 (17:52 +0200)
committerTomek Mrugalski <tomasz@isc.org>
Tue, 25 Jul 2017 15:52:09 +0000 (17:52 +0200)
src/lib/cc/simple_parser.h
src/lib/cc/tests/simple_parser_unittest.cc
src/lib/dhcpsrv/parsers/client_class_def_parser.cc
src/lib/dhcpsrv/parsers/duid_config_parser.cc

index 3ff60b7bb86f84c52e783f6a4d06e7d083d2e785..b8f2fb2e5dfda0cdeab1f04a34add90bc657798b 100644 (file)
@@ -204,6 +204,7 @@ protected:
         }
     }
 
+public:
     /// @brief Returns a value converted to uint32_t
     ///
     /// Instantiation of getIntType() to uint32_t
index 0a8bf579880a00aaed9292bb87fb4ab068c38580..aaffe47ddc3f2cbde313e5165d4a023b5187ba53 100644 (file)
@@ -58,10 +58,6 @@ public:
 
 class SimpleParserClassTest : public SimpleParser {
 public:
-
-    /// Make getUint8 public
-    using SimpleParser::getUint8;
-
     /// @brief Instantiation of getAndConvert
     ///
     /// @param scope specified parameter will be extracted from this scope
index a16eb6f4cc09a4e21cb41ce09fde381ae0dc7315..0180371958344c08af1d907b3bb823bc9f0607b4 100644 (file)
@@ -101,15 +101,13 @@ ClientClassDefParser::parse(ClientClassDictionaryPtr& class_dictionary,
 
         if (next_server.getFamily() != AF_INET) {
             isc_throw(DhcpConfigError, "Invalid next-server value: '"
-                      << next_server_txt
-                      << "', must be IPv4 address ("
+                      << next_server_txt << "', must be IPv4 address ("
                       << getPosition("next-server", class_def_cfg) << ")");
         }
 
         if (next_server.isV4Bcast()) {
             isc_throw(DhcpConfigError, "Invalid next-server value: '"
-                      << next_server_txt
-                      << "', must not be a broadcast ("
+                      << next_server_txt << "', must not be a broadcast ("
                       << getPosition("next-server", class_def_cfg) << ")");
         }
     }
@@ -146,7 +144,7 @@ ClientClassDefParser::parse(ClientClassDictionaryPtr& class_dictionary,
         class_dictionary->addClass(name, match_expr, options, next_server,
                                    sname, filename);
     } catch (const std::exception& ex) {
-        isc_throw(DhcpConfigError, ex.what()
+        isc_throw(DhcpConfigError, "Can't add class: " << ex.what()
                   << " (" << class_def_cfg->getPosition() << ")");
     }
 }
index 00116d8d8e26352e860f5553211091e944125649..355e4f7e719e8f19c455ce62c97c011a6b2858e4 100644 (file)
@@ -26,6 +26,9 @@ namespace dhcp {
 void
 DUIDConfigParser::parse(const CfgDUIDPtr& cfg,
                         isc::data::ConstElementPtr duid_configuration) {
+    if (!cfg) {
+        isc_throw(DhcpConfigError, "Must provide valid pointer to cfg when parsing duid");
+    }
 
     std::string param;
     try {