resolved: cache - cache what we can of negative redirect chains
authorTom Gundersen <teg@jklm.no>
Thu, 3 Sep 2015 23:58:20 +0000 (01:58 +0200)
committerTom Gundersen <teg@jklm.no>
Wed, 16 Sep 2015 15:03:18 +0000 (17:03 +0200)
commit5eefe544efbfbbd0d0026ca28913a9e82fec187c
tree99ef11732f301e00ac213d58a91690dd4f9b66f8
parent5643c00afe29eae4b2e3575277038e60e6967d09
resolved: cache - cache what we can of negative redirect chains

When a NXDATA or a NODATA response is received for an alias it may
include CNAME records from the redirect chain. We should cache the
response for each of these names to avoid needless roundtrips in
the future.

It is not sufficient to do the negative caching only for the
canonical name, as the included redirection chain is not guaranteed
to be complete. In fact, only the final CNAME record from the chain
is guaranteed to be included.

We take care not to cache entries that redirects outside the current
zone, as the SOA will then not be valid.
src/resolve/resolved-dns-answer.c
src/resolve/resolved-dns-answer.h
src/resolve/resolved-dns-cache.c