]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#572] style changes to address review comments
authorWlodek Wencel <wlodek@isc.org>
Wed, 20 Nov 2019 05:59:47 +0000 (12:59 +0700)
committerTomek Mrugalski <tomasz@isc.org>
Wed, 20 Nov 2019 06:52:57 +0000 (14:52 +0800)
src/bin/perfdhcp/stats_mgr.h
src/bin/perfdhcp/test_control.cc

index 4a7e4294a35d7ad4c1521daea8e0c0ff0b57dfa8..ff4aa427f8f8e02c504a3e0869c4ee8dc9e57862 100644 (file)
@@ -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.
     ///
index 2dc7933afd1f85ea75495dc4a91b9911a3e776fd..b48402cb4a77d7466cbc1824b2457c4845a33cba 100644 (file)
@@ -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;
     }