- extra checks for parent pointer
- comments corrected
// we should have one value on the stack
ASSERT_EQ(1, values_.size());
- // The option should NOT be found (there is option 82),
+ // The option should NOT be found (there is no option 82),
// so the expression should evaluate to ""
EXPECT_EQ("", values_.top());
OptionPtr
TokenSubOption::getSubOption(const OptionPtr& parent) {
+ if (!parent) {
+ return (OptionPtr());
+ }
return (parent->getOption(sub_option_code_));
}
/// @brief Token that represents sub-options in DHCPv4 and DHCPv6.
///
/// It covers any options which encapsulate sub-options, for instance
-/// dhcp-agent-options (72, DHCPv4) or rsoo (66, DHCPv6).
+/// dhcp-agent-options (82, DHCPv4) or rsoo (66, DHCPv6).
/// This class is derived from TokenOption and leverages its ability
/// to operate on sub-options. It also adds additional capabilities.
///