]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
perfdhcp avalanche: added ipv6 part
authorMichal Nowikowski <godfryd@isc.org>
Wed, 13 Feb 2019 11:39:33 +0000 (12:39 +0100)
committerMichal Nowikowski <godfryd@isc.org>
Tue, 19 Feb 2019 20:54:31 +0000 (21:54 +0100)
src/bin/perfdhcp/avalanche_scen.cc

index e997f7494caab696991ea4a109f796b6119b31d8..3c96946305e372388c88ec9774e150eaea430d64 100644 (file)
@@ -102,12 +102,23 @@ AvalancheScen::run() {
         now = microsec_clock::universal_time();
         if (now - prev_cycle_time > milliseconds(200)) { // check if 0.2s elapsed
             prev_cycle_time = now;
-            auto still_left_cnt_do = resendPackets(ExchangeType::DO);
-            auto still_left_cnt_ra = resendPackets(ExchangeType::RA);
-            if (still_left_cnt_do + still_left_cnt_ra == 0) {
+            int still_left_cnt = 0;
+            if (options.getIpVersion() == 4) {
+                still_left_cnt += resendPackets(ExchangeType::DO);
+                still_left_cnt += resendPackets(ExchangeType::RA);
+            } else {
+                still_left_cnt += resendPackets(ExchangeType::SA);
+                still_left_cnt += resendPackets(ExchangeType::RR);
+            }
+
+            if (still_left_cnt == 0) {
                 break;
             }
         }
+
+        if (tc_.interrupted()) {
+            break;
+        }
     }
 
     auto stop = microsec_clock::universal_time();