// Consistency: if the destination is the query the source must be
// the query too.
if (!opt_cfg->getDestination() && !opt_cfg->getSource()) {
- isc_throw(BadValue, "destination 'query' requires source 'query'");
+ isc_throw(BadValue, "destination 'query' requires source 'query'");
}
// Not working as expected: the destination is the query and classes
break;
}
}
-
}
void
- @b source - Specifies what is the source for expression evaluation.
The default is the query but this can be changed to the response.
Note that if an expression includes a member clause the query classes
- are copied to the response to make this to work.
+ are copied to the response to make this work.
- @b destination - Specifies what is the destination of option changes.
The default is the response but this can be changed to the query.
Note the change is performed before the classification so
- @ client-class or a member clause in expression is very likely
+ @b client-class or a member clause in expression is very likely
to not work as expected. A warning is emitted when this situation
is detected when the configuration is parsed.
}
}
-
/// @brief Log the client class for option.
///
/// @param client_class The client class aka guard name.
This warning message indicates the config specifies an expression
with a member clause when the destination is the query but the callout point
for patching queries is before the classification so it will very likely
-not work as expected. The code of the sub-option and option, and the
+not work as expected. The codes of the sub-option and option, and the
expression are displayed.
% FLEX_OPTION_CONFIG_USELESS_CLASS For the option code %1 the client class %2 is required before classification for a query destination
EXPECT_EQ(0U, countFile("FLEX_OPTION_CONFIG_USELESS_MEMBER"));
}
-// Verify that client-classes does not trigger a warning by default.
+// Verify that TokenMember triggers a warning with query destination.
TEST_F(FlexOptionLogTest, memberWarning) {
ElementPtr options = Element::createList();
ElementPtr option = Element::createMap();
EXPECT_TRUE(impl_->getErrMsg().empty()) << impl_->getErrMsg();
Pkt4Ptr query(new Pkt4(DHCPDISCOVER, 12345));
-
EXPECT_NO_THROW(impl_->process<Pkt4Ptr>(Option::V4, query, Pkt4Ptr()));
}
EXPECT_EQ(0U, countFile("FLEX_OPTION_CONFIG_SUB_USELESS_MEMBER"));
}
-// Verify that client-classes does not trigger a warning by default.
+// Verify that TokenMember triggers a warning with query destination.
TEST_F(FlexSubOptionLogTest, memberWarning) {
OptionDefSpaceContainer defs;
OptionDefinitionPtr def(new OptionDefinition("my-container", 222,