diff options
author | Andrei Pavel <andrei@isc.org> | 2023-06-28 18:46:10 +0200 |
---|---|---|
committer | Andrei Pavel <andrei@isc.org> | 2023-06-28 18:46:10 +0200 |
commit | 9cf6db22520c0314031f2279bda71a172ab7732b (patch) | |
tree | 0268ec3564d1c479a1b46ee14e4043d2628f3beb | |
parent | [#2831] addressed review comments (diff) | |
download | kea-9cf6db22520c0314031f2279bda71a172ab7732b.tar.xz kea-9cf6db22520c0314031f2279bda71a172ab7732b.zip |
[#2831] fix some dead assignments
-rw-r--r-- | src/bin/d2/d2_process.cc | 3 | ||||
-rw-r--r-- | src/hooks/dhcp/high_availability/libloadtests/close_unittests.cc | 2 | ||||
-rw-r--r-- | src/lib/dhcp/tests/libdhcp++_unittest.cc | 1 | ||||
-rw-r--r-- | src/lib/dhcpsrv/iterative_allocator.cc | 2 | ||||
-rw-r--r-- | src/lib/tcp/tcp_stream_msg.cc | 2 |
5 files changed, 3 insertions, 7 deletions
diff --git a/src/bin/d2/d2_process.cc b/src/bin/d2/d2_process.cc index 956d500ab7..ab12dd6dad 100644 --- a/src/bin/d2/d2_process.cc +++ b/src/bin/d2/d2_process.cc @@ -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; } diff --git a/src/hooks/dhcp/high_availability/libloadtests/close_unittests.cc b/src/hooks/dhcp/high_availability/libloadtests/close_unittests.cc index b6e45a81fb..1c91e1c959 100644 --- a/src/hooks/dhcp/high_availability/libloadtests/close_unittests.cc +++ b/src/hooks/dhcp/high_availability/libloadtests/close_unittests.cc @@ -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) { diff --git a/src/lib/dhcp/tests/libdhcp++_unittest.cc b/src/lib/dhcp/tests/libdhcp++_unittest.cc index ff1811c1e0..9f7ff5187f 100644 --- a/src/lib/dhcp/tests/libdhcp++_unittest.cc +++ b/src/lib/dhcp/tests/libdhcp++_unittest.cc @@ -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)); diff --git a/src/lib/dhcpsrv/iterative_allocator.cc b/src/lib/dhcpsrv/iterative_allocator.cc index 751c1485a0..6ec2b8c5bd 100644 --- a/src/lib/dhcpsrv/iterative_allocator.cc +++ b/src/lib/dhcpsrv/iterative_allocator.cc @@ -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 diff --git a/src/lib/tcp/tcp_stream_msg.cc b/src/lib/tcp/tcp_stream_msg.cc index 1435292bf7..23f2bc99ae 100644 --- a/src/lib/tcp/tcp_stream_msg.cc +++ b/src/lib/tcp/tcp_stream_msg.cc @@ -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; } |