Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions worker/include/dpdk_filter/constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

#include <stdint.h>

#define DNS_CACHE_DEFAULT_TTL (7 * 24 * 60 * 60) // 7 дней
#define IP_CACHE_DEFAULT_TTL (7 * 24 * 60 * 60) // 7 дней
#define FORWARD_TO_OUT_BURST_SIZE 32
#define MAX_CATEGORIES_BY_TRUST_LVL 64
#define MAX_DOMAINS 64
Expand Down
6 changes: 6 additions & 0 deletions worker/src/worker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,12 @@ void Worker::MainLoop() {
{
std::lock_guard<std::mutex> lock(policy_mutex);
local_policy = current_policy;
if (local_policy.ttl_domain <= 0) {
local_policy.ttl_domain = DNS_CACHE_DEFAULT_TTL;
}
if (local_policy.ttl_ip <= 0) {
local_policy.ttl_ip = IP_CACHE_DEFAULT_TTL;
}
}
forward_to_out(port_exception, port_in, queue_number);
pakage_processing(port_in, port_out, port_exception, queue_number, nb_pkts,
Expand Down
Loading