[func]* fdupont
- Modified the behavior of required client classes
- configured without a test expression: they are now
- unconditionally added as they always evaluate to
- true (vs false previously).
+ Classes included in 'require-client-classes' that do
+ not have test expressions will now be unconditionally
+ added to the client's list of matching classes.
+ Previously they were ignored.
(Gitlab #3388)
extern const isc::log::MessageID DHCP4_REQUEST = "DHCP4_REQUEST";
extern const isc::log::MessageID DHCP4_REQUIRED_CLASS_EVAL_ERROR = "DHCP4_REQUIRED_CLASS_EVAL_ERROR";
extern const isc::log::MessageID DHCP4_REQUIRED_CLASS_EVAL_RESULT = "DHCP4_REQUIRED_CLASS_EVAL_RESULT";
+extern const isc::log::MessageID DHCP4_REQUIRED_CLASS_NO_TEST = "DHCP4_REQUIRED_CLASS_NO_TEST";
extern const isc::log::MessageID DHCP4_REQUIRED_CLASS_UNDEFINED = "DHCP4_REQUIRED_CLASS_UNDEFINED";
-extern const isc::log::MessageID DHCP4_REQUIRED_CLASS_UNTESTABLE = "DHCP4_REQUIRED_CLASS_UNTESTABLE";
extern const isc::log::MessageID DHCP4_RESERVATIONS_LOOKUP_FIRST_ENABLED = "DHCP4_RESERVATIONS_LOOKUP_FIRST_ENABLED";
extern const isc::log::MessageID DHCP4_RESERVED_HOSTNAME_ASSIGNED = "DHCP4_RESERVED_HOSTNAME_ASSIGNED";
extern const isc::log::MessageID DHCP4_RESPONSE_DATA = "DHCP4_RESPONSE_DATA";
"DHCP4_REQUEST", "%1: server is processing DHCPREQUEST with hint=%2",
"DHCP4_REQUIRED_CLASS_EVAL_ERROR", "%1: Expression '%2' evaluated to %3",
"DHCP4_REQUIRED_CLASS_EVAL_RESULT", "%1: Expression '%2' evaluated to %3",
+ "DHCP4_REQUIRED_CLASS_NO_TEST", "required class %1 has no test expression",
"DHCP4_REQUIRED_CLASS_UNDEFINED", "required class %1 has no definition",
- "DHCP4_REQUIRED_CLASS_UNTESTABLE", "required class %1 has no test expression",
"DHCP4_RESERVATIONS_LOOKUP_FIRST_ENABLED", "Multi-threading is enabled and host reservations lookup is always performed first.",
"DHCP4_RESERVED_HOSTNAME_ASSIGNED", "%1: server assigned reserved hostname %2",
"DHCP4_RESPONSE_DATA", "%1: responding with packet %2 (type %3), packet details: %4",
extern const isc::log::MessageID DHCP4_REQUEST;
extern const isc::log::MessageID DHCP4_REQUIRED_CLASS_EVAL_ERROR;
extern const isc::log::MessageID DHCP4_REQUIRED_CLASS_EVAL_RESULT;
+extern const isc::log::MessageID DHCP4_REQUIRED_CLASS_NO_TEST;
extern const isc::log::MessageID DHCP4_REQUIRED_CLASS_UNDEFINED;
-extern const isc::log::MessageID DHCP4_REQUIRED_CLASS_UNTESTABLE;
extern const isc::log::MessageID DHCP4_RESERVATIONS_LOOKUP_FIRST_ENABLED;
extern const isc::log::MessageID DHCP4_RESERVED_HOSTNAME_ASSIGNED;
extern const isc::log::MessageID DHCP4_RESPONSE_DATA;
been successfully evaluated. The client class name and the result value of the
evaluation are printed.
-% DHCP4_REQUIRED_CLASS_UNDEFINED required class %1 has no definition
-Logged at debug log level 40.
-This debug message informs that a class is listed for required evaluation but
-has no definition. The class is ignored.
-
-% DHCP4_REQUIRED_CLASS_UNTESTABLE required class %1 has no test expression
+% DHCP4_REQUIRED_CLASS_NO_TEST required class %1 has no test expression
Logged at debug log level 40.
This debug message informs that a class was listed for required evaluation but
its definition does not include a test expression to evaluate. The class is
unconditionally added to the query.
+% DHCP4_REQUIRED_CLASS_UNDEFINED required class %1 has no definition
+Logged at debug log level 40.
+This debug message informs that a class is listed for required evaluation but
+has no definition. The class is ignored.
+
% DHCP4_RESERVATIONS_LOOKUP_FIRST_ENABLED Multi-threading is enabled and host reservations lookup is always performed first.
This is a message informing that host reservations lookup is performed before
lease lookup when multi-threading is enabled overwriting configured value.
// Add a class without an expression to evaluate
if (!expr_ptr) {
LOG_DEBUG(dhcp4_logger, DBG_DHCP4_BASIC,
- DHCP4_REQUIRED_CLASS_UNTESTABLE)
+ DHCP4_REQUIRED_CLASS_NO_TEST)
.arg(cclass);
query->addClass(cclass);
continue;
}
// This test checks a required class which is not defined is ignored.
-TEST_F(ClassifyTest, requiredNoDefined) {
+// Please set KEA_LOGGER_DESTINATION to stderr or stdout and check
+// that DHCP4_REQUIRED_CLASS_UNDEFINED is logged,
+TEST_F(ClassifyTest, requiredNotDefined) {
std::string config =
"{"
"\"interfaces-config\": {"
extern const isc::log::MessageID DHCP6_RELEASE_PD_FAIL_WRONG_IAID = "DHCP6_RELEASE_PD_FAIL_WRONG_IAID";
extern const isc::log::MessageID DHCP6_REQUIRED_CLASS_EVAL_ERROR = "DHCP6_REQUIRED_CLASS_EVAL_ERROR";
extern const isc::log::MessageID DHCP6_REQUIRED_CLASS_EVAL_RESULT = "DHCP6_REQUIRED_CLASS_EVAL_RESULT";
+extern const isc::log::MessageID DHCP6_REQUIRED_CLASS_NO_TEST = "DHCP6_REQUIRED_CLASS_NO_TEST";
extern const isc::log::MessageID DHCP6_REQUIRED_CLASS_UNDEFINED = "DHCP6_REQUIRED_CLASS_UNDEFINED";
-extern const isc::log::MessageID DHCP6_REQUIRED_CLASS_UNTESTABLE = "DHCP6_REQUIRED_CLASS_UNTESTABLE";
extern const isc::log::MessageID DHCP6_REQUIRED_OPTIONS_CHECK_FAIL = "DHCP6_REQUIRED_OPTIONS_CHECK_FAIL";
extern const isc::log::MessageID DHCP6_RESERVATIONS_LOOKUP_FIRST_ENABLED = "DHCP6_RESERVATIONS_LOOKUP_FIRST_ENABLED";
extern const isc::log::MessageID DHCP6_RESPONSE_DATA = "DHCP6_RESPONSE_DATA";
"DHCP6_RELEASE_PD_FAIL_WRONG_IAID", "%1: client tried to release prefix %2/%3, but it used wrong IAID (expected %4, but got %5)",
"DHCP6_REQUIRED_CLASS_EVAL_ERROR", "%1: Expression '%2' evaluated to %3",
"DHCP6_REQUIRED_CLASS_EVAL_RESULT", "%1: Expression '%2' evaluated to %3",
+ "DHCP6_REQUIRED_CLASS_NO_TEST", "required class %1 has no test expression",
"DHCP6_REQUIRED_CLASS_UNDEFINED", "required class %1 has no definition",
- "DHCP6_REQUIRED_CLASS_UNTESTABLE", "required class %1 has no test expression",
"DHCP6_REQUIRED_OPTIONS_CHECK_FAIL", "%1: %2 message received from %3 failed the following check: %4",
"DHCP6_RESERVATIONS_LOOKUP_FIRST_ENABLED", "Multi-threading is enabled and host reservations lookup is always performed first.",
"DHCP6_RESPONSE_DATA", "%1: responding with packet %2 (type %3), packet details: %4",
extern const isc::log::MessageID DHCP6_RELEASE_PD_FAIL_WRONG_IAID;
extern const isc::log::MessageID DHCP6_REQUIRED_CLASS_EVAL_ERROR;
extern const isc::log::MessageID DHCP6_REQUIRED_CLASS_EVAL_RESULT;
+extern const isc::log::MessageID DHCP6_REQUIRED_CLASS_NO_TEST;
extern const isc::log::MessageID DHCP6_REQUIRED_CLASS_UNDEFINED;
-extern const isc::log::MessageID DHCP6_REQUIRED_CLASS_UNTESTABLE;
extern const isc::log::MessageID DHCP6_REQUIRED_OPTIONS_CHECK_FAIL;
extern const isc::log::MessageID DHCP6_RESERVATIONS_LOOKUP_FIRST_ENABLED;
extern const isc::log::MessageID DHCP6_RESPONSE_DATA;
been successfully evaluated. The client class name and the result value of the
evaluation are printed.
-% DHCP6_REQUIRED_CLASS_UNDEFINED required class %1 has no definition
-Logged at debug log level 40.
-This debug message informs that a class is listed for required evaluation but
-has no definition. The class is ignored.
-
-% DHCP6_REQUIRED_CLASS_UNTESTABLE required class %1 has no test expression
+% DHCP6_REQUIRED_CLASS_NO_TEST required class %1 has no test expression
Logged at debug log level 40.
This debug message informs that a class was listed for required evaluation but
its definition does not include a test expression to evaluate. The class is
unconditionally added to the query.
+% DHCP6_REQUIRED_CLASS_UNDEFINED required class %1 has no definition
+Logged at debug log level 40.
+This debug message informs that a class is listed for required evaluation but
+has no definition. The class is ignored.
+
% DHCP6_REQUIRED_OPTIONS_CHECK_FAIL %1: %2 message received from %3 failed the following check: %4
Logged at debug log level 40.
This message indicates that received DHCPv6 packet is invalid. This may be due
// Add a class without an expression to evaluate
if (!expr_ptr) {
LOG_DEBUG(dhcp6_logger, DBG_DHCP6_BASIC,
- DHCP6_REQUIRED_CLASS_UNTESTABLE)
+ DHCP6_REQUIRED_CLASS_NO_TEST)
.arg(cclass);
pkt->addClass(cclass);
continue;
}
// This test checks a required class which is not defined is ignored.
-TEST_F(ClassifyTest, requiredNoDefined) {
+// Please set KEA_LOGGER_DESTINATION to stderr or stdout and check
+// that DHCP6_REQUIRED_CLASS_UNDEFINED is logged,
+TEST_F(ClassifyTest, requiredNotDefined) {
std::string config =
"{"
"\"interfaces-config\": {"