Skip to content

Commit

Permalink
auth: update canHashPacket() calls accordingly
Browse files Browse the repository at this point in the history
  • Loading branch information
chbruyand committed Oct 1, 2021
1 parent 6cf1e05 commit 717d882
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion pdns/auth-packetcache.cc
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ bool AuthPacketCache::get(DNSPacket& p, DNSPacket& cached)

cleanupIfNeeded();

uint32_t hash = canHashPacket(p.getString(), /* don't skip ECS */ false);
static const std::unordered_set<uint16_t> optionsToSkip{ EDNSOptionCode::COOKIE};
uint32_t hash = canHashPacket(p.getString(), /* don't skip ECS */optionsToSkip);
p.setHash(hash);

string value;
Expand Down
2 changes: 1 addition & 1 deletion pdns/test-packetcache_cc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ try
we directly compute the hash instead of querying the
cache because 1/ it's faster 2/ no deferred-lookup issues
*/
q.setHash(g_PC->canHashPacket(q.getString(), false));
q.setHash(g_PC->canHashPacket(q.getString()));

const unsigned int maxTTL = 3600;
g_PC->insert(q, r, maxTTL);
Expand Down

0 comments on commit 717d882

Please sign in to comment.