lib: implement NS reputation, write address election code
Problem
if a NS has an unreachable address, resolver discards the whole nameserver record. Then the nameserver record is fetched again and random server is tried leading to the same error. This leads to short resolution loops for broken servers.
Example
0.gravatar.com A
ns1.edgecastcdn.net. has broken AAAA records, leading to resolution fail
Expected behaviour
if an address is unreachable, it should be marked as this in the reputation system. On the next iteration, address election should be ran and different address should be selected.
-
Zone cut keeps a set of addresses to choose from (instead of just one)
-
Needs a different structure to avoid frequent realloc (
pack
) - Zone cut needs a map of NS names to records
-
Needs a different structure to avoid frequent realloc (
- Rework iterator to use address set
- Best address election function
-
Keep elected address in the
kr_query
(as sockaddr) - Prefer IPv6 if possible (bonus score)
- Fuzzy selection (message id may be used as a random value)