From: Wlodek Wencel Date: Wed, 20 Nov 2019 05:59:47 +0000 (+0700) Subject: [#572] style changes to address review comments X-Git-Tag: Kea-1.7.2~74 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4446ebd405103e3270a415fdc6974d41932d754b;p=thirdparty%2Fkea.git [#572] style changes to address review comments --- diff --git a/src/bin/perfdhcp/stats_mgr.h b/src/bin/perfdhcp/stats_mgr.h index 4a7e4294a3..ff4aa427f8 100644 --- a/src/bin/perfdhcp/stats_mgr.h +++ b/src/bin/perfdhcp/stats_mgr.h @@ -996,8 +996,9 @@ public: /// Method increase total number of rejected leases by one /// for specified exchange type void updateRejLeases(const ExchangeType xchg_type) { - ExchangeStatsPtr xchg_stats = getExchangeStats(xchg_type); - xchg_stats->updateRejLeases(); } + ExchangeStatsPtr xchg_stats = getExchangeStats(xchg_type); + xchg_stats->updateRejLeases(); + } /// \brief Get time period since the start of test. /// diff --git a/src/bin/perfdhcp/test_control.cc b/src/bin/perfdhcp/test_control.cc index 2dc7933afd..b48402cb4a 100644 --- a/src/bin/perfdhcp/test_control.cc +++ b/src/bin/perfdhcp/test_control.cc @@ -815,17 +815,17 @@ TestControl::validateIA(const Pkt6Ptr& pkt6) { iaaddr = boost::dynamic_pointer_cast< Option6IAAddr>(pkt6->getOption(D6O_IA_NA)->getOption(D6O_IAADDR)); } - if ((options_.getLeaseType() - .includes(CommandOptions::LeaseType::ADDRESS_AND_PREFIX) && iapref && iaaddr) - || (options_.getLeaseType() - .includes(CommandOptions::LeaseType::PREFIX) && iapref - && !options_.getLeaseType() - .includes(CommandOptions::LeaseType::ADDRESS_AND_PREFIX)) - || (options_.getLeaseType() - .includes(CommandOptions::LeaseType::ADDRESS) && iaaddr - && !options_.getLeaseType() - .includes(CommandOptions::LeaseType::ADDRESS_AND_PREFIX))) { - return true; + + bool address_and_prefix = options_.getLeaseType().includes( + CommandOptions::LeaseType::ADDRESS_AND_PREFIX); + bool prefix_only = options_.getLeaseType().includes( + CommandOptions::LeaseType::PREFIX); + bool address_only = options_.getLeaseType().includes( + CommandOptions::LeaseType::ADDRESS); + if ((address_and_prefix && iapref && iaaddr) || + (prefix_only && iapref && !address_and_prefix) || + (address_only && iaaddr && !address_and_prefix)) { + return true; } else { return false; }