Browse Source

[3467] Addressed review comments.

Marcin Siodelski 10 years ago
parent
commit
0c9206653b

+ 1 - 1
doc/guide/dhcp4-srv.xml

@@ -1097,7 +1097,7 @@ temporarily override a list of interface names and listen on all interfaces.
     </section>
 
     <section id="dhcp4-option-data-defaults">
-      <title>Unspecified parameters for option configuration</title>
+      <title>Unspecified parameters for DHCPv4 option configuration</title>
       <para>In many cases it is not required to specify all parameters for
       an option configuration and the default values may be used. However, it is
       important to understand the implications of not specifing some of them

+ 1 - 1
doc/guide/dhcp6-srv.xml

@@ -1088,7 +1088,7 @@ should include options from the isc option space:
     </section>
 
     <section id="dhcp6-option-data-defaults">
-      <title>Unspecified parameters for option configuration</title>
+      <title>Unspecified parameters for DHCPv6 option configuration</title>
       <para>In many cases it is not required to specify all parameters for
       an option configuration and the default values can be used. However, it is
       important to understand the implications of not specifing some of them

+ 2 - 2
src/lib/dhcp/libdhcp++.h

@@ -1,4 +1,4 @@
-// Copyright (C) 2011-2013 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2011-2014 Internet Systems Consortium, Inc. ("ISC")
 //
 // Permission to use, copy, modify, and/or distribute this software for any
 // purpose with or without fee is hereby granted, provided that the above
@@ -61,7 +61,7 @@ public:
     /// @param u universe (v4 or V6)
     /// @param name Option name.
     ///
-    /// @return Pointer the option definition or NULL pointer it option
+    /// @return Pointer to the option definition or NULL pointer if option
     /// definition has not been found.
     static OptionDefinitionPtr getOptionDef(const Option::Universe u,
                                             const std::string& name);

+ 5 - 2
src/lib/dhcpsrv/dhcp_parsers.cc

@@ -350,7 +350,9 @@ OptionDataParser::extractCode(ConstElementPtr parent) const {
         code = uint32_values_->getParam("code");
 
     } catch (const exception& ex) {
-        return (OptionalValue<uint32_t>(code));
+        // The code parameter was not found. Return an unspecified
+        // value.
+        return (OptionalValue<uint32_t>());
     }
 
     if (code == 0) {
@@ -385,7 +387,7 @@ OptionDataParser::extractName(ConstElementPtr parent) const {
         name = string_values_->getParam("name");
 
     } catch (...) {
-        return (OptionalValue<std::string>(name));
+        return (OptionalValue<std::string>());
     }
 
     if (name.find(" ") != std::string::npos) {
@@ -404,6 +406,7 @@ OptionDataParser::extractData() const {
         data = string_values_->getParam("data");
 
     } catch (...) {
+        // The "data" parameter was not found. Return an empty value.
         return (data);
     }
 

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

@@ -596,7 +596,7 @@ private:
     /// @brief Retrieves parsed option name as an optional value.
     ///
     /// @param parent A data element holding full option data configuration.
-    /// It is used here to log a position if the element holding a code
+    /// It is used here to log a position if the element holding a name
     /// is not specified and its position is therefore unavailable.
     ///
     /// @return Option name, possibly unspecified.