Skip to content

Commit 69b8a64

Browse files
committed
++ cache
1 parent 7375dc6 commit 69b8a64

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

storage/cache.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,16 @@ void NHTFlowCache::export_expired(const timeval& now)
540540

541541
bool NHTFlowCache::create_hash_key(const Packet& packet)
542542
{
543+
if (packet.ip_version == IP::v4) {
544+
m_key = FlowKeyv4{};
545+
m_key_reversed = FlowKeyv4{};
546+
} else if (packet.ip_version == IP::v6) {
547+
m_key = FlowKeyv6{};
548+
m_key_reversed = FlowKeyv6{};
549+
} else {
550+
return false;
551+
}
552+
543553
auto commonFieldsAssigner = [&](auto& key)
544554
{
545555
key.src_port = packet.src_port;

0 commit comments

Comments
 (0)