]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#2615] fixed limits with built-in classes
authorRazvan Becheriu <razvan@isc.org>
Thu, 27 Oct 2022 16:07:29 +0000 (19:07 +0300)
committerRazvan Becheriu <razvan@isc.org>
Thu, 17 Nov 2022 12:05:22 +0000 (12:05 +0000)
src/bin/dhcp4/tests/dhcp4_srv_unittest.cc
src/hooks/dhcp/high_availability/tests/ha_impl_unittest.cc
src/lib/dhcp/pkt.cc

index 3f552bf9a98b9f609caa04f01c83c9937fa80d9b..aa4395959063de7ac15e094ea5c35c522164072d 100644 (file)
@@ -5023,6 +5023,8 @@ TEST_F(Dhcpv4SrvTest, fixedFieldsInClassOrder) {
             HWAddrPtr hw_addr(new HWAddr(HWAddr::fromText(scenario.hw_str_, 10)));
             query->setHWAddr(hw_addr);
 
+            srv.classifyPacket(query);
+
             // Process it.
             Pkt4Ptr response = srv.processDiscover(query);
 
index 6282e7749e41f805b3cd4692c933f1f7810b004d..38c1d9a02a2a008516e27205e4410920ff9013d3 100644 (file)
@@ -234,8 +234,7 @@ TEST_F(HAImplTest, buffer4Receive) {
 
     // The client class should be assigned to the message to indicate that the
     // server1 should process this message.
-    ASSERT_EQ(2, query4->getClasses().size());
-    EXPECT_TRUE(query4->inClass("ALL"));
+    ASSERT_EQ(1, query4->getClasses().size());
     EXPECT_TRUE(query4->inClass("HA_server1"));
 
     // Check that the message has been parsed. The DHCP message type should
@@ -323,8 +322,7 @@ TEST_F(HAImplTest, buffer6Receive) {
 
     // The client class should be assigned to the message to indicate that the
     // server1 should process this message.
-    ASSERT_EQ(2, query6->getClasses().size());
-    EXPECT_TRUE(query6->inClass("ALL"));
+    ASSERT_EQ(1, query6->getClasses().size());
     EXPECT_TRUE(query6->inClass("HA_server1"));
 
     // Check that the message has been parsed. The DHCP message type should
index 55949497ab14043938c7f367b505947dba66857c..8a63cda0c11c7af157dfe10cb979e4c27cdf8515 100644 (file)
@@ -82,10 +82,6 @@ Pkt::inClass(const ClientClass& client_class) {
 
 void
 Pkt::addClass(const ClientClass& client_class, bool required) {
-    // Always have ALL first.
-    if (classes_.empty()) {
-        classes_.insert("ALL");
-    }
     ClientClasses& classes = !required ? classes_ : required_classes_;
     if (!classes.contains(client_class)) {
         classes.insert(client_class);
@@ -95,10 +91,6 @@ Pkt::addClass(const ClientClass& client_class, bool required) {
 
 void
 Pkt::addSubClass(const ClientClass& class_def, const ClientClass& subclass) {
-    // Always have ALL first.
-    if (classes_.empty()) {
-        classes_.insert("ALL");
-    }
     if (!classes_.contains(class_def)) {
         classes_.insert(class_def);
         static_cast<void>(subclasses_.push_back(SubClassRelation(class_def, subclass)));