Browse Source

[4097a] Added a new message for unconfigured classes

Francis Dupont 9 years ago
parent
commit
0c120e9d3e
2 changed files with 7 additions and 1 deletions
  1. 3 0
      src/bin/dhcp4/dhcp4_messages.mes
  2. 4 1
      src/bin/dhcp4/dhcp4_srv.cc

+ 3 - 0
src/bin/dhcp4/dhcp4_messages.mes

@@ -84,6 +84,9 @@ The first argument specifies the client and transaction identification
 information. The second argument includes all classes to which the
 information. The second argument includes all classes to which the
 packet has been assigned.
 packet has been assigned.
 
 
+% DHCP4_CLASS_UNCONFIGURED %1: client packet belongs an unconfigured class: %2
+This debug message informs that incoming packet belongs to a class which cannot be found in the configuration. Either a hook written before the classification was added to Kea is used, or class naming is inconsistent.
+
 % DHCP4_CLIENTID_IGNORED_FOR_LEASES %1: not using client identifier for lease allocation for subnet %2
 % DHCP4_CLIENTID_IGNORED_FOR_LEASES %1: not using client identifier for lease allocation for subnet %2
 This debug message is issued when the server is processing the DHCPv4 message
 This debug message is issued when the server is processing the DHCPv4 message
 for which client identifier will not be used when allocating new lease or
 for which client identifier will not be used when allocating new lease or

+ 4 - 1
src/bin/dhcp4/dhcp4_srv.cc

@@ -2394,7 +2394,10 @@ Dhcpv4Srv::classSpecificProcessing(const Dhcpv4Exchange& ex) {
         const ClientClassDefPtr& ccdef = CfgMgr::instance().getCurrentCfg()->
         const ClientClassDefPtr& ccdef = CfgMgr::instance().getCurrentCfg()->
             getClientClassDictionary()->findClass(*cclass);
             getClientClassDictionary()->findClass(*cclass);
         if (!ccdef) {
         if (!ccdef) {
-            // Not found
+            // Not found: the class is not configured
+	    LOG_DEBUG(options4_logger, DBG_DHCP4_BASIC, DHCP4_CLASS_UNCONFIGURED)
+		.arg(query->getLabel())
+		.arg(*cclass);
             continue;
             continue;
         }
         }
 	// For each requested option code get the instance of the option
 	// For each requested option code get the instance of the option