From 0c9206653b4f8ba4372dabad16f0c3109d46e517 Mon Sep 17 00:00:00 2001 From: Marcin Siodelski Date: Tue, 9 Dec 2014 09:31:41 +0100 Subject: [PATCH] [3467] Addressed review comments. --- doc/guide/dhcp4-srv.xml | 2 +- doc/guide/dhcp6-srv.xml | 2 +- src/lib/dhcp/libdhcp++.h | 4 ++-- src/lib/dhcpsrv/dhcp_parsers.cc | 7 +++++-- src/lib/dhcpsrv/dhcp_parsers.h | 2 +- 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/doc/guide/dhcp4-srv.xml b/doc/guide/dhcp4-srv.xml index cd40316ecd..14565d1f20 100644 --- a/doc/guide/dhcp4-srv.xml +++ b/doc/guide/dhcp4-srv.xml @@ -1097,7 +1097,7 @@ temporarily override a list of interface names and listen on all interfaces.
- Unspecified parameters for option configuration + Unspecified parameters for DHCPv4 option configuration 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 diff --git a/doc/guide/dhcp6-srv.xml b/doc/guide/dhcp6-srv.xml index 3b84661291..a69662aa9c 100644 --- a/doc/guide/dhcp6-srv.xml +++ b/doc/guide/dhcp6-srv.xml @@ -1088,7 +1088,7 @@ should include options from the isc option space:
- Unspecified parameters for option configuration + Unspecified parameters for DHCPv6 option configuration 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 diff --git a/src/lib/dhcp/libdhcp++.h b/src/lib/dhcp/libdhcp++.h index de25da891e..45b0ae388d 100644 --- a/src/lib/dhcp/libdhcp++.h +++ b/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); diff --git a/src/lib/dhcpsrv/dhcp_parsers.cc b/src/lib/dhcpsrv/dhcp_parsers.cc index a62cfb76ea..542c0947a9 100644 --- a/src/lib/dhcpsrv/dhcp_parsers.cc +++ b/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(code)); + // The code parameter was not found. Return an unspecified + // value. + return (OptionalValue()); } if (code == 0) { @@ -385,7 +387,7 @@ OptionDataParser::extractName(ConstElementPtr parent) const { name = string_values_->getParam("name"); } catch (...) { - return (OptionalValue(name)); + return (OptionalValue()); } 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); } diff --git a/src/lib/dhcpsrv/dhcp_parsers.h b/src/lib/dhcpsrv/dhcp_parsers.h index f83fbfb72c..a0999622ef 100644 --- a/src/lib/dhcpsrv/dhcp_parsers.h +++ b/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. -- 2.47.3