]> git.ipfire.org Git - thirdparty/knot-resolver.git/commit
client-subnet WIP: mainly cache changes client-subnet-wip
authorVladimír Čunát <vladimir.cunat@nic.cz>
Tue, 18 Oct 2016 11:26:02 +0000 (13:26 +0200)
committerVladimír Čunát <vladimir.cunat@nic.cz>
Tue, 18 Oct 2016 11:28:15 +0000 (13:28 +0200)
commit1853a8c1248ca16e686852a04bf04053b3431829
tree513cf73ebb55c73153166b1793e2da6c70df0110
parentce28b17330a651f47efdfe09c036cb2c80a55b19
client-subnet WIP: mainly cache changes

Status: all deckard tests succeed (non-ECS).

Design plan:

- It was decided to deviate from rfc7871, as full
implementation would be potentially very cache-hungry
(there are very many meaningful IP prefixes).
Instead, a geo DB will be used to partition IPs into discrete
categories.  That's what the authoritative NSs use AFAIK.

- For now the granularity would be a country, as used by
https://www.maxmind.com/en/geoip2-databases

- Cache deduplicates equal records for different locations.
That's implemented by splitting the mapping into two:
usual key + location -> hash, and usual key + hash -> RRdata.
Timestamp and TTL of the RRset is stored in the first part,
and the stored RRs have TTLs zeroed.
(All this forced changes in lib/cache.h API.)
15 files changed:
Makefile
lib/cache.c
lib/cache.h
lib/client_subnet.h [new file with mode: 0644]
lib/layer/pktcache.c
lib/layer/rrcache.c
lib/resolve.c
lib/rplan.c
lib/rplan.h
lib/utils.h
lib/zonecut.c
modules/client_subnet/client_subnet.c [new file with mode: 0644]
modules/client_subnet/client_subnet.mk [new file with mode: 0644]
modules/modules.mk
tests/test_cache.c