From: Francis Dupont Date: Thu, 6 Nov 2025 14:44:29 +0000 (+0100) Subject: [#3140] Moved to "whole" processing X-Git-Tag: Kea-3.1.4~58 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d64f24d2959eb5f5c22959fa10185379fd0d6f70;p=thirdparty%2Fkea.git [#3140] Moved to "whole" processing --- diff --git a/doc/sphinx/arm/dhcp4-srv.rst b/doc/sphinx/arm/dhcp4-srv.rst index f4f3de365f..a615e47b1e 100644 --- a/doc/sphinx/arm/dhcp4-srv.rst +++ b/doc/sphinx/arm/dhcp4-srv.rst @@ -7435,9 +7435,11 @@ The DHCPv4 server supports the following statistics: | | | the most common reasons may be | | | | that an unacceptable packet type | | | | was received, direct responses are | - | | | forbidden, or the server ID sent | - | | | by the client does not match the | - | | | server's server ID. | + | | | forbidden, the server ID sent by | + | | | the client does not match the | + | | | server's server ID, or an | + | | | unexpected error occurred during | + | | | processing. | +----------------------------------------------------+----------------+------------------------------------+ | subnet[id].total-addresses | integer | Total number of addresses | | | | available for DHCPv4 management | diff --git a/doc/sphinx/arm/dhcp6-srv.rst b/doc/sphinx/arm/dhcp6-srv.rst index 2dc3caee4c..e193b5cced 100644 --- a/doc/sphinx/arm/dhcp6-srv.rst +++ b/doc/sphinx/arm/dhcp6-srv.rst @@ -7001,8 +7001,9 @@ The DHCPv6 server supports the following statistics: | | | received, direct responses are | | | | forbidden, the server ID sent by | | | | the client does not match the | - | | | server's server ID, or the packet | - | | | is malformed. | + | | | server's server ID, the packet | + | | | is malformed, or an unexpected | + | | | error occurred during processing. | +---------------------------------------------------+----------------+------------------------------------+ | pkt6-solicit-received | integer | Number of SOLICIT packets | | | | received. This statistic is | diff --git a/src/bin/dhcp4/dhcp4_srv.cc b/src/bin/dhcp4/dhcp4_srv.cc index 4efbe15e2e..08173156df 100644 --- a/src/bin/dhcp4/dhcp4_srv.cc +++ b/src/bin/dhcp4/dhcp4_srv.cc @@ -1337,29 +1337,29 @@ Dhcpv4Srv::processPacketAndSendResponseNoThrow(Pkt4Ptr query) { LOG_ERROR(packet4_logger, DHCP4_PACKET_PROCESS_STD_EXCEPTION) .arg(query->getLabel()) .arg(e.what()); + StatsMgr::instance().addValue("pkt4-processing-failed", + static_cast(1)); + StatsMgr::instance().addValue("pkt4-receive-drop", + static_cast(1)); } catch (...) { LOG_ERROR(packet4_logger, DHCP4_PACKET_PROCESS_EXCEPTION) .arg(query->getLabel()); + StatsMgr::instance().addValue("pkt4-processing-failed", + static_cast(1)); + StatsMgr::instance().addValue("pkt4-receive-drop", + static_cast(1)); } } void Dhcpv4Srv::processPacketAndSendResponse(Pkt4Ptr query) { - Pkt4Ptr rsp; - try { - rsp = processPacket(query); - if (!rsp) { - return; - } - } catch (...) { - StatsMgr::instance().addValue("pkt4-processing-failed", - static_cast(1)); - StatsMgr::instance().addValue("pkt4-receive-drop", - static_cast(1)); - throw; + Pkt4Ptr rsp = processPacket(query); + if (!rsp) { + return; } CalloutHandlePtr callout_handle = getCalloutHandle(query); + processPacketBufferSend(callout_handle, rsp); } @@ -1568,18 +1568,9 @@ void Dhcpv4Srv::processDhcp4QueryAndSendResponse(Pkt4Ptr query, bool allow_answer_park) { try { - Pkt4Ptr rsp; - try { - rsp = processDhcp4Query(query, allow_answer_park); - if (!rsp) { - return; - } - } catch (...) { - StatsMgr::instance().addValue("pkt4-processing-failed", - static_cast(1)); - StatsMgr::instance().addValue("pkt4-receive-drop", - static_cast(1)); - throw; + Pkt4Ptr rsp = processDhcp4Query(query, allow_answer_park); + if (!rsp) { + return; } CalloutHandlePtr callout_handle = getCalloutHandle(query); @@ -1588,9 +1579,17 @@ Dhcpv4Srv::processDhcp4QueryAndSendResponse(Pkt4Ptr query, LOG_ERROR(packet4_logger, DHCP4_PACKET_PROCESS_STD_EXCEPTION) .arg(query->getLabel()) .arg(e.what()); + StatsMgr::instance().addValue("pkt4-processing-failed", + static_cast(1)); + StatsMgr::instance().addValue("pkt4-receive-drop", + static_cast(1)); } catch (...) { LOG_ERROR(packet4_logger, DHCP4_PACKET_PROCESS_EXCEPTION) .arg(query->getLabel()); + StatsMgr::instance().addValue("pkt4-processing-failed", + static_cast(1)); + StatsMgr::instance().addValue("pkt4-receive-drop", + static_cast(1)); } } @@ -1670,18 +1669,9 @@ Dhcpv4Srv::processLocalizedQuery4AndSendResponse(Pkt4Ptr query, AllocEngine::ClientContext4Ptr& ctx, bool allow_answer_park) { try { - Pkt4Ptr rsp; - try { - rsp = processLocalizedQuery4(ctx, allow_answer_park); - if (!rsp) { - return; - } - } catch (...) { - StatsMgr::instance().addValue("pkt4-processing-failed", - static_cast(1)); - StatsMgr::instance().addValue("pkt4-receive-drop", - static_cast(1)); - throw; + Pkt4Ptr rsp = processLocalizedQuery4(ctx, allow_answer_park); + if (!rsp) { + return; } CalloutHandlePtr callout_handle = getCalloutHandle(query); @@ -1691,9 +1681,17 @@ Dhcpv4Srv::processLocalizedQuery4AndSendResponse(Pkt4Ptr query, LOG_ERROR(packet4_logger, DHCP4_PACKET_PROCESS_STD_EXCEPTION) .arg(query->getLabel()) .arg(e.what()); + StatsMgr::instance().addValue("pkt4-processing-failed", + static_cast(1)); + StatsMgr::instance().addValue("pkt4-receive-drop", + static_cast(1)); } catch (...) { LOG_ERROR(packet4_logger, DHCP4_PACKET_PROCESS_EXCEPTION) .arg(query->getLabel()); + StatsMgr::instance().addValue("pkt4-processing-failed", + static_cast(1)); + StatsMgr::instance().addValue("pkt4-receive-drop", + static_cast(1)); } } diff --git a/src/bin/dhcp6/dhcp6_srv.cc b/src/bin/dhcp6/dhcp6_srv.cc index 08b794e447..3f32b8ab97 100644 --- a/src/bin/dhcp6/dhcp6_srv.cc +++ b/src/bin/dhcp6/dhcp6_srv.cc @@ -812,26 +812,25 @@ Dhcpv6Srv::processPacketAndSendResponseNoThrow(Pkt6Ptr query) { LOG_ERROR(packet6_logger, DHCP6_PACKET_PROCESS_STD_EXCEPTION) .arg(query->getLabel()) .arg(e.what()); + StatsMgr::instance().addValue("pkt6-processing-failed", + static_cast(1)); + StatsMgr::instance().addValue("pkt6-receive-drop", + static_cast(1)); } catch (...) { LOG_ERROR(packet6_logger, DHCP6_PACKET_PROCESS_EXCEPTION) .arg(query->getLabel()); + StatsMgr::instance().addValue("pkt6-processing-failed", + static_cast(1)); + StatsMgr::instance().addValue("pkt6-receive-drop", + static_cast(1)); } } void Dhcpv6Srv::processPacketAndSendResponse(Pkt6Ptr query) { - Pkt6Ptr rsp; - try { - rsp = processPacket(query); - if (!rsp) { - return; - } - } catch (...) { - StatsMgr::instance().addValue("pkt6-processing-failed", - static_cast(1)); - StatsMgr::instance().addValue("pkt6-receive-drop", - static_cast(1)); - throw; + Pkt6Ptr rsp = processPacket(query); + if (!rsp) { + return; } CalloutHandlePtr callout_handle = getCalloutHandle(query); @@ -1042,18 +1041,9 @@ Dhcpv6Srv::processPacket(Pkt6Ptr query) { void Dhcpv6Srv::processDhcp6QueryAndSendResponse(Pkt6Ptr query) { try { - Pkt6Ptr rsp; - try { - rsp = processDhcp6Query(query); - if (!rsp) { - return; - } - } catch (...) { - StatsMgr::instance().addValue("pkt6-processing-failed", - static_cast(1)); - StatsMgr::instance().addValue("pkt6-receive-drop", - static_cast(1)); - throw; + Pkt6Ptr rsp = processDhcp6Query(query); + if (!rsp) { + return; } CalloutHandlePtr callout_handle = getCalloutHandle(query); @@ -1062,9 +1052,17 @@ Dhcpv6Srv::processDhcp6QueryAndSendResponse(Pkt6Ptr query) { LOG_ERROR(packet6_logger, DHCP6_PACKET_PROCESS_STD_EXCEPTION) .arg(query->getLabel()) .arg(e.what()); + StatsMgr::instance().addValue("pkt6-processing-failed", + static_cast(1)); + StatsMgr::instance().addValue("pkt6-receive-drop", + static_cast(1)); } catch (...) { LOG_ERROR(packet6_logger, DHCP6_PACKET_PROCESS_EXCEPTION) .arg(query->getLabel()); + StatsMgr::instance().addValue("pkt6-processing-failed", + static_cast(1)); + StatsMgr::instance().addValue("pkt6-receive-drop", + static_cast(1)); } } @@ -1118,18 +1116,9 @@ void Dhcpv6Srv::processLocalizedQuery6AndSendResponse(Pkt6Ptr query, AllocEngine::ClientContext6& ctx) { try { - Pkt6Ptr rsp; - try { - rsp = processLocalizedQuery6(ctx); - if (!rsp) { - return; - } - } catch (...) { - StatsMgr::instance().addValue("pkt6-processing-failed", - static_cast(1)); - StatsMgr::instance().addValue("pkt6-receive-drop", - static_cast(1)); - throw; + Pkt6Ptr rsp = processLocalizedQuery6(ctx); + if (!rsp) { + return; } CalloutHandlePtr callout_handle = getCalloutHandle(query); @@ -1138,9 +1127,17 @@ Dhcpv6Srv::processLocalizedQuery6AndSendResponse(Pkt6Ptr query, LOG_ERROR(packet6_logger, DHCP6_PACKET_PROCESS_STD_EXCEPTION) .arg(query->getLabel()) .arg(e.what()); + StatsMgr::instance().addValue("pkt6-processing-failed", + static_cast(1)); + StatsMgr::instance().addValue("pkt6-receive-drop", + static_cast(1)); } catch (...) { LOG_ERROR(packet6_logger, DHCP6_PACKET_PROCESS_EXCEPTION) .arg(query->getLabel()); + StatsMgr::instance().addValue("pkt6-processing-failed", + static_cast(1)); + StatsMgr::instance().addValue("pkt6-receive-drop", + static_cast(1)); } } diff --git a/src/hooks/dhcp/lease_query/lease_query_callouts.cc b/src/hooks/dhcp/lease_query/lease_query_callouts.cc index d6d54cb677..1dcaef1cbe 100644 --- a/src/hooks/dhcp/lease_query/lease_query_callouts.cc +++ b/src/hooks/dhcp/lease_query/lease_query_callouts.cc @@ -140,9 +140,8 @@ int buffer4_receive(CalloutHandle& handle) { StatsMgr::instance().addValue("pkt4-lease-query-received", static_cast(1)); bool invalid = false; - bool sending = false; try { - LeaseQueryImplFactory::getImpl().processQuery(query, invalid, sending); + LeaseQueryImplFactory::getImpl().processQuery(query, invalid); } catch (const std::exception& ex) { // Failed to parse the packet. LOG_DEBUG(lease_query_logger, DBGLVL_TRACE_BASIC, @@ -151,9 +150,6 @@ int buffer4_receive(CalloutHandle& handle) { .arg(ex.what()); handle.setStatus(CalloutHandle::NEXT_STEP_DROP); - if (sending) { - return (0); - } if (!invalid) { StatsMgr::instance().addValue("pkt4-processing-failed", static_cast(1)); @@ -232,9 +228,8 @@ int buffer6_receive(CalloutHandle& handle) { StatsMgr::instance().addValue("pkt6-lease-query-received", static_cast(1)); bool invalid = false; - bool sending = false; try { - LeaseQueryImplFactory::getImpl().processQuery(query, invalid, sending); + LeaseQueryImplFactory::getImpl().processQuery(query, invalid); } catch (const std::exception& ex) { // Log that we failed to process the packet. LOG_DEBUG(lease_query_logger, DBGLVL_TRACE_BASIC, @@ -243,9 +238,6 @@ int buffer6_receive(CalloutHandle& handle) { .arg(ex.what()); handle.setStatus(CalloutHandle::NEXT_STEP_DROP); - if (sending) { - return (0); - } if (!invalid) { StatsMgr::instance().addValue("pkt6-processing-failed", static_cast(1)); diff --git a/src/hooks/dhcp/lease_query/lease_query_impl.h b/src/hooks/dhcp/lease_query/lease_query_impl.h index 2f86a043c9..f7a0b7374d 100644 --- a/src/hooks/dhcp/lease_query/lease_query_impl.h +++ b/src/hooks/dhcp/lease_query/lease_query_impl.h @@ -113,10 +113,8 @@ public: /// must use dynamic_casting). /// @param invalid Reference to a flag set to true when the query /// is invalid (used to detect unexpected exceptions). - /// @param sending Reference to a flag set to true when the query was - /// processed and response will be built and sent. virtual void processQuery(isc::dhcp::PktPtr base_query, - bool& invalid, bool& sending) const = 0; + bool& invalid) const = 0; /// @brief Keywords for Lease Query configuration. static const isc::data::SimpleKeywords LEASE_QUERY_KEYWORDS; diff --git a/src/hooks/dhcp/lease_query/lease_query_impl4.cc b/src/hooks/dhcp/lease_query/lease_query_impl4.cc index f5c79687b1..34a1060302 100644 --- a/src/hooks/dhcp/lease_query/lease_query_impl4.cc +++ b/src/hooks/dhcp/lease_query/lease_query_impl4.cc @@ -47,8 +47,7 @@ LeaseQueryImpl4::LeaseQueryImpl4(const ConstElementPtr config) }; void -LeaseQueryImpl4::processQuery(PktPtr base_query, bool& invalid, - bool& sending) const { +LeaseQueryImpl4::processQuery(PktPtr base_query, bool& invalid) const { Pkt4Ptr query = boost::dynamic_pointer_cast(base_query); if (!query) { // Shouldn't happen. @@ -127,7 +126,6 @@ LeaseQueryImpl4::processQuery(PktPtr base_query, bool& invalid, << "]"); } - sending = true; Pkt4Ptr response = buildResponse(response_type, query, leases); /// Send the response if we have one if (response) { diff --git a/src/hooks/dhcp/lease_query/lease_query_impl4.h b/src/hooks/dhcp/lease_query/lease_query_impl4.h index 3e0aab00cf..055d13bb09 100644 --- a/src/hooks/dhcp/lease_query/lease_query_impl4.h +++ b/src/hooks/dhcp/lease_query/lease_query_impl4.h @@ -40,10 +40,8 @@ public: /// @param base_query DHCPv4 lease query to process. /// @param invalid Reference to a flag set to true when the query /// is invalid (used to detect unexpected exceptions). - /// @param sending Reference to a flag set to true when the query was - /// processed and response will be built and sent. virtual void processQuery(isc::dhcp::PktPtr base_query, - bool& invalid, bool& sending) const; + bool& invalid) const; /// @brief Queries for an active lease matching an ip address /// diff --git a/src/hooks/dhcp/lease_query/lease_query_impl6.cc b/src/hooks/dhcp/lease_query/lease_query_impl6.cc index d3d09829e9..3a5ec8e511 100644 --- a/src/hooks/dhcp/lease_query/lease_query_impl6.cc +++ b/src/hooks/dhcp/lease_query/lease_query_impl6.cc @@ -90,8 +90,7 @@ LeaseQueryImpl6::LeaseQueryImpl6(const ConstElementPtr config) } void -LeaseQueryImpl6::processQuery(PktPtr base_query, bool& invalid, - bool& sending) const { +LeaseQueryImpl6::processQuery(PktPtr base_query, bool& invalid) const { Pkt6Ptr query = boost::dynamic_pointer_cast(base_query); if (!query) { // Shouldn't happen. @@ -202,7 +201,6 @@ LeaseQueryImpl6::processQuery(PktPtr base_query, bool& invalid, } // Construct the reply. - sending = true; Pkt6Ptr reply = buildReply(status_opt, query, leases); if (reply) { sendResponse(reply); diff --git a/src/hooks/dhcp/lease_query/lease_query_impl6.h b/src/hooks/dhcp/lease_query/lease_query_impl6.h index 98acaee3d8..c131ac5a9e 100644 --- a/src/hooks/dhcp/lease_query/lease_query_impl6.h +++ b/src/hooks/dhcp/lease_query/lease_query_impl6.h @@ -51,12 +51,10 @@ public: /// @param base_query DHCPv6 lease query to process. /// @param invalid Reference to a flag set to true when the query /// is invalid (used to detect unexpected exceptions). - /// @param sending Reference to a flag set to true when the query was - /// processed and response will be built and sent. /// @throw BadValue if the query is invalid for a number reasons, /// including if it comes from an unauthorized requester. virtual void processQuery(isc::dhcp::PktPtr base_query, - bool& invalid, bool& sending) const; + bool& invalid) const; /// @brief Queries for an active lease matching an ip address. /// diff --git a/src/hooks/dhcp/lease_query/tests/lease_query_impl4_unittest.cc b/src/hooks/dhcp/lease_query/tests/lease_query_impl4_unittest.cc index 7aec48155b..30e09802f5 100644 --- a/src/hooks/dhcp/lease_query/tests/lease_query_impl4_unittest.cc +++ b/src/hooks/dhcp/lease_query/tests/lease_query_impl4_unittest.cc @@ -638,11 +638,9 @@ TEST(LeaseQueryImpl4Test, processQueryInvalidQuery) { // A v6 packet should get tossed. Pkt6Ptr pkt6(new Pkt6(DHCPV6_LEASEQUERY, 0)); bool invalid = false; - bool sending = false; - ASSERT_THROW_MSG(impl->processQuery(pkt6, invalid, sending), BadValue, + ASSERT_THROW_MSG(impl->processQuery(pkt6, invalid), BadValue, "LeaseQueryImpl4 query is not DHCPv4 packet"); EXPECT_FALSE(invalid); - EXPECT_FALSE(sending); // Set the pkt4-rfc-violation stat to 0. StatsMgr::instance().setValue("pkt4-rfc-violation", static_cast(0)); @@ -650,11 +648,9 @@ TEST(LeaseQueryImpl4Test, processQueryInvalidQuery) { // An empty giaddr should fail. Pkt4Ptr lq(new Pkt4(DHCPLEASEQUERY, 123)); invalid = false; - sending = false; - ASSERT_THROW_MSG(impl->processQuery(lq, invalid, sending), BadValue, + ASSERT_THROW_MSG(impl->processQuery(lq, invalid), BadValue, "giaddr cannot be 0.0.0.0"); EXPECT_TRUE(invalid); - EXPECT_FALSE(sending); // Check the pkt4-rfc-violation stat which was bumped by one. ObservationPtr stat_rv = @@ -668,11 +664,9 @@ TEST(LeaseQueryImpl4Test, processQueryInvalidQuery) { // An unknown giaddr should fail. lq->setGiaddr(IOAddress("192.0.2.2")); invalid = false; - sending = false; - ASSERT_THROW_MSG(impl->processQuery(lq, invalid, sending), BadValue, + ASSERT_THROW_MSG(impl->processQuery(lq, invalid), BadValue, "rejecting query from unauthorized requester: 192.0.2.2"); EXPECT_TRUE(invalid); - EXPECT_FALSE(sending); // Check the pkt4-admin-filtered stat which was bumped by one. ObservationPtr stat_af = @@ -747,11 +741,9 @@ TEST(LeaseQueryImpl4Test, processQueryInvalidQuery) { } invalid = false; - sending = false; - ASSERT_THROW_MSG(impl->processQuery(lq, invalid, sending), BadValue, + ASSERT_THROW_MSG(impl->processQuery(lq, invalid), BadValue, scenario.exp_message_); EXPECT_TRUE(invalid); - EXPECT_FALSE(sending); } } diff --git a/src/hooks/dhcp/lease_query/tests/lease_query_impl6_unittest.cc b/src/hooks/dhcp/lease_query/tests/lease_query_impl6_unittest.cc index 28503f31c9..1f7ffb0de3 100644 --- a/src/hooks/dhcp/lease_query/tests/lease_query_impl6_unittest.cc +++ b/src/hooks/dhcp/lease_query/tests/lease_query_impl6_unittest.cc @@ -682,11 +682,9 @@ TEST_F(MemfileLeaseQueryImpl6ProcessTest, processQueryInvalidQuery) { // A v4 packet should get tossed. Pkt4Ptr pkt4(new Pkt4(DHCPLEASEQUERY, 0)); bool invalid = false; - bool sending = false; - ASSERT_THROW_MSG(impl->processQuery(pkt4, invalid, sending), BadValue, + ASSERT_THROW_MSG(impl->processQuery(pkt4, invalid), BadValue, "LeaseQueryImpl6 query is not DHCPv6 packet"); EXPECT_FALSE(invalid); - EXPECT_FALSE(sending); // Set the pkt6-rfc-violation stat to 0. StatsMgr::instance().setValue("pkt6-rfc-violation", static_cast(0)); @@ -694,11 +692,9 @@ TEST_F(MemfileLeaseQueryImpl6ProcessTest, processQueryInvalidQuery) { // No client-id option should fail. Pkt6Ptr lq(new Pkt6(DHCPV6_LEASEQUERY_REPLY, 123)); invalid = false; - sending = false; - ASSERT_THROW_MSG(impl->processQuery(lq, invalid, sending), BadValue, + ASSERT_THROW_MSG(impl->processQuery(lq, invalid), BadValue, "DHCPV6_LEASEQUERY must supply a D6O_CLIENTID"); EXPECT_TRUE(invalid); - EXPECT_FALSE(sending); // Check the pkt6-rfc-violation stat which was bumped by one. ObservationPtr stat_rv = StatsMgr::instance().getObservation("pkt6-rfc-violation"); @@ -714,12 +710,10 @@ TEST_F(MemfileLeaseQueryImpl6ProcessTest, processQueryInvalidQuery) { // Add an a non-matching server id. lq->addOption(makeServerIdOption(std::vector{ 10, 11, 12, 13, 14, 15, 16 })); invalid = false; - sending = false; - ASSERT_THROW_MSG(impl->processQuery(lq, invalid, sending), BadValue, + ASSERT_THROW_MSG(impl->processQuery(lq, invalid), BadValue, "rejecting DHCPV6_LEASEQUERY from: ::," " unknown server-id: type=00002, len=00007: 0a:0b:0c:0d:0e:0f:10"); EXPECT_TRUE(invalid); - EXPECT_FALSE(sending); // Check the pkt6-not-for-us stat which was bumped by one. ObservationPtr stat_nfu = StatsMgr::instance().getObservation("pkt6-not-for-us"); @@ -732,11 +726,9 @@ TEST_F(MemfileLeaseQueryImpl6ProcessTest, processQueryInvalidQuery) { // Source address cannot be ::. invalid = false; - sending = false; - ASSERT_THROW_MSG(impl->processQuery(lq, invalid, sending), BadValue, + ASSERT_THROW_MSG(impl->processQuery(lq, invalid), BadValue, "DHCPV6_LEASEQUERY source address cannot be ::"); EXPECT_TRUE(invalid); - EXPECT_FALSE(sending); // Set the pkt6-admin-filtered stat to 0. StatsMgr::instance().setValue("pkt6-admin-filtered", static_cast(0)); @@ -746,11 +738,9 @@ TEST_F(MemfileLeaseQueryImpl6ProcessTest, processQueryInvalidQuery) { // An unknown requester should fail. invalid = false; - sending = false; - ASSERT_THROW_MSG(impl->processQuery(lq, invalid, sending), BadValue, + ASSERT_THROW_MSG(impl->processQuery(lq, invalid), BadValue, "rejecting DHCPV6_LEASEQUERY from unauthorized requester: de:ad:be:ef::"); EXPECT_TRUE(invalid); - EXPECT_FALSE(sending); // Check the pkt6-admin-filtered stat which was bumped by one. ObservationPtr stat_af = StatsMgr::instance().getObservation("pkt6-admin-filtered"); @@ -762,11 +752,9 @@ TEST_F(MemfileLeaseQueryImpl6ProcessTest, processQueryInvalidQuery) { // A query without a D6O_LQ_QUERY option should fail. invalid = false; - sending = false; - ASSERT_THROW_MSG(impl->processQuery(lq, invalid, sending), BadValue, + ASSERT_THROW_MSG(impl->processQuery(lq, invalid), BadValue, "DHCPV6_LEASEQUERY must supply a D6O_LQ_QUERY option"); EXPECT_TRUE(invalid); - EXPECT_FALSE(sending); } // Verifies the operation of LeaseQueryImpl6::initReply(). @@ -1448,10 +1436,8 @@ TEST_F(MemfileLeaseQueryImpl6ProcessTest, processQueryInvalidWithStatus) { scenario.qry_cid_); // Process the query. bool invalid = false; - bool sending = false; - ASSERT_NO_THROW_LOG(impl->processQuery(lq, invalid, sending)); + ASSERT_NO_THROW_LOG(impl->processQuery(lq, invalid)); EXPECT_FALSE(invalid); - EXPECT_TRUE(sending); // We should have generated a LEASE_QUERY_REPLY with a // status option containing the expected status. @@ -1551,10 +1537,8 @@ BaseLeaseQueryImpl6ProcessTest::testQueryByIpAddressNoActiveLe // Process the query. bool invalid = false; - bool sending = false; - ASSERT_NO_THROW_LOG(impl->processQuery(lq, invalid, sending)); + ASSERT_NO_THROW_LOG(impl->processQuery(lq, invalid)); EXPECT_FALSE(invalid); - EXPECT_TRUE(sending); // We should have generated a DHCPV6_LEASEQUERY_REPLY with a // status option containing the expected status. @@ -1607,10 +1591,8 @@ BaseLeaseQueryImpl6ProcessTest::testQueryByIpAddressActiveLeas // Process the query. bool invalid = false; - bool sending = false; - ASSERT_NO_THROW_LOG(impl->processQuery(lq, invalid, sending)); + ASSERT_NO_THROW_LOG(impl->processQuery(lq, invalid)); EXPECT_FALSE(invalid); - EXPECT_TRUE(sending); // We should have generated a DHCPV6_LEASEQUERY_REPLY with a // status option containing the successful status. @@ -1694,10 +1676,8 @@ BaseLeaseQueryImpl6ProcessTest::testQueryByClientIdNoActiveLea // Process the query. bool invalid = false; - bool sending = false; - ASSERT_NO_THROW_LOG(impl->processQuery(lq, invalid, sending)); + ASSERT_NO_THROW_LOG(impl->processQuery(lq, invalid)); EXPECT_FALSE(invalid); - EXPECT_TRUE(sending); // We should have generated a LEASE_QUERY_REPLY with a // status option containing the expected status. @@ -1744,10 +1724,8 @@ BaseLeaseQueryImpl6ProcessTest::testQueryByClientIdMultipleLin // Process the query. bool invalid = false; - bool sending = false; - ASSERT_NO_THROW_LOG(impl->processQuery(lq, invalid, sending)); + ASSERT_NO_THROW_LOG(impl->processQuery(lq, invalid)); EXPECT_FALSE(invalid); - EXPECT_TRUE(sending); // We should have generated a LEASE_QUERY_REPLY with a // status option containing the expected status. @@ -1821,10 +1799,8 @@ BaseLeaseQueryImpl6ProcessTest::testQueryByClientIdActiveLease // Process the query. bool invalid = false; - bool sending = false; - ASSERT_NO_THROW_LOG(impl->processQuery(lq, invalid, sending)); + ASSERT_NO_THROW_LOG(impl->processQuery(lq, invalid)); EXPECT_FALSE(invalid); - EXPECT_TRUE(sending); // We should have generated a LEASE_QUERY_REPLY with a // status option containing the expected status. @@ -2085,10 +2061,8 @@ BaseLeaseQueryImpl6ProcessTest::testQueryByIpaddressPDLeases() // Process the query. bool invalid = false; - bool sending = false; - ASSERT_NO_THROW_LOG(impl->processQuery(lq, invalid, sending)); + ASSERT_NO_THROW_LOG(impl->processQuery(lq, invalid)); EXPECT_FALSE(invalid); - EXPECT_TRUE(sending); // We should have generated a LEASE_QUERY_REPLY with a // status option containing the expected status.