Browse Source

[master] Merge branch 'trac3343' (DHCPv4 client classification fix)

Conflicts:
	ChangeLog
Tomek Mrugalski 11 years ago
parent
commit
b78dc55330
2 changed files with 10 additions and 3 deletions
  1. 5 0
      ChangeLog
  2. 5 3
      src/bin/dhcp4/dhcp4_srv.cc

+ 5 - 0
ChangeLog

@@ -1,3 +1,8 @@
+764.	[bug]		tomek
+	b10-dhcp4: Fixed a bug caused client classification to not work
+	properly.
+	(Trac #3343, git 1801400ac874380e7a565d373b4bae96a49e21f7)
+
 763.	[func]		tmark
 	b10-dhcp-ddns may now be configured to disable DNS updates in
 	in a given direction by simply not defining any domains for that

+ 5 - 3
src/bin/dhcp4/dhcp4_srv.cc

@@ -232,6 +232,11 @@ Dhcpv4Srv::run() {
             }
         }
 
+        // Assign this packet to one or more classes if needed. We need to do
+        // this before calling accept(), because getSubnet4() may need client
+        // class information.
+        classifyPacket(query);
+
         // Check whether the message should be further processed or discarded.
         // There is no need to log anything here. This function logs by itself.
         if (!accept(query)) {
@@ -274,9 +279,6 @@ Dhcpv4Srv::run() {
             callout_handle->getArgument("query4", query);
         }
 
-        // Assign this packet to one or more classes if needed
-        classifyPacket(query);
-
         try {
             switch (query->getType()) {
             case DHCPDISCOVER: