]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#2831] fix some dead assignments
authorAndrei Pavel <andrei@isc.org>
Wed, 28 Jun 2023 16:46:10 +0000 (19:46 +0300)
committerAndrei Pavel <andrei@isc.org>
Wed, 28 Jun 2023 16:46:10 +0000 (19:46 +0300)
src/bin/d2/d2_process.cc
src/hooks/dhcp/high_availability/libloadtests/close_unittests.cc
src/lib/dhcp/tests/libdhcp++_unittest.cc
src/lib/dhcpsrv/iterative_allocator.cc
src/lib/tcp/tcp_stream_msg.cc

index 956d500ab7cfc93b8b031050d0053cce9cdc1817..ab12dd6dad5a623484bbdb0de861b57a9acbfdae 100644 (file)
@@ -450,7 +450,7 @@ D2Process::getD2CfgMgr() {
 }
 
 const char* D2Process::getShutdownTypeStr(const ShutdownType& type) {
-    const char* str = "invalid";
+    const char* str;
     switch (type) {
     case SD_NORMAL:
         str = "normal";
@@ -462,6 +462,7 @@ const char* D2Process::getShutdownTypeStr(const ShutdownType& type) {
         str = "now";
         break;
     default:
+        str = "invalid";
         break;
     }
 
index b6e45a81fbe2f5e467043e309cb7f10dbefc0363..1c91e1c95937d0c41d8709447622697ab03374ed 100644 (file)
@@ -310,11 +310,9 @@ CloseHATest::runPartners(bool const backup /* = true */) {
     wthread_->clearReady(WatchedThread::TERMINATE);
     if (accept_partner1 >= 0) {
         close(accept_partner1);
-        accept_partner1 = -1;
     }
     if (accept_partner2 >= 0) {
         close(accept_partner2);
-        accept_partner2 = -1;
     }
     for (auto reader : readers) {
         if (!reader.second) {
index ff1811c1e0b3c0bff6dc399b9dd779c88177b721..9f7ff5187f85a67d9ab6ebcc51459c3034fdb634 100644 (file)
@@ -2323,7 +2323,6 @@ TEST_F(LibDhcpTest, option43End) {
     LibDHCP::commitRuntimeOptionDefs();
 
     options.clear();
-    offset = 0;
     ASSERT_NO_THROW(offset = LibDHCP::unpackOptions4(buf, space,
                                                      options, deferred, true));
 
index 751c1485a0ef8ef6dfee744d826e397760230559..6ec2b8c5bd5c38a0b934f26d250afe27e8dd49d5 100644 (file)
@@ -172,7 +172,6 @@ IterativeAllocator::pickAddressInternal(const ClientClasses& client_classes,
                 return (next);
             }
 
-            valid = false;
             getPoolState(*it)->resetLastAllocated();
         }
         // We hit pool boundary, let's try to jump to the next pool and try again
@@ -316,7 +315,6 @@ IterativeAllocator::pickPrefixInternal(const ClientClasses& client_classes,
                 return (next);
             }
 
-            valid = false;
             getPoolState(*it)->resetLastAllocated();
         }
         // We hit pool boundary, let's try to jump to the next pool and try again
index 1435292bf74a47cf3350469354d8c68ad950e11d..23f2bc99aebfc8a987e2f1305bfc975c8a626d6a 100644 (file)
@@ -38,7 +38,7 @@ TcpStreamRequest::postBuffer(const void* buf, const size_t nbytes) {
             size_t need_bytes = expected_size_ - wire_size;
             size_t copy_bytes = (need_bytes <= bytes_left ? need_bytes : bytes_left);
             wire_data_.insert(wire_data_.end(), bufptr, bufptr + copy_bytes);
-            bytes_left -= copy_bytes;
+            // bytes_left -= copy_bytes;  // Since we break, we don't need to do this anymore.
             bytes_used += copy_bytes;
             break;
         }