summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancis Dupont <fdupont@isc.org>2024-07-19 17:54:09 +0200
committerFrancis Dupont <fdupont@isc.org>2024-07-19 17:54:09 +0200
commit0c81dc7b25a19cae520da7971892fd411d69a381 (patch)
tree5a217f0184a2411f6f9c744a47e8f048e6fff8b7
parent[#3440] Moved to a single vector (diff)
downloadkea-0c81dc7b25a19cae520da7971892fd411d69a381.tar.xz
kea-0c81dc7b25a19cae520da7971892fd411d69a381.zip
[#3440] Moved to a map of pairs
-rw-r--r--src/lib/dhcp/libdhcp++.cc7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/lib/dhcp/libdhcp++.cc b/src/lib/dhcp/libdhcp++.cc
index daa66567d3..e2795d9593 100644
--- a/src/lib/dhcp/libdhcp++.cc
+++ b/src/lib/dhcp/libdhcp++.cc
@@ -530,8 +530,7 @@ LibDHCP::unpackOptions4(const OptionBuffer& buf, const string& option_space,
}
// Fusing option buffers.
- unordered_map<uint8_t, OptionBuffer> fused;
- unordered_map<uint8_t, uint32_t> seen;
+ unordered_map<uint8_t, pair<OptionBuffer, uint32_t>> fused;
// Second pass.
offset = 0;
@@ -595,9 +594,9 @@ LibDHCP::unpackOptions4(const OptionBuffer& buf, const string& option_space,
// Concatenate multiple instance of an option.
uint32_t opt_count = count[opt_type];
if (opt_count > 1) {
- OptionBuffer& previous = fused[opt_type];
+ OptionBuffer& previous = fused[opt_type].first;
previous.insert(previous.end(), obuf.begin(), obuf.end());
- uint32_t& already_seen = seen[opt_type];
+ uint32_t& already_seen = fused[opt_type].second;
++already_seen;
if (already_seen != opt_count) {
continue;