chiark / gitweb /
src/types.c: Handle inconsistent CNAME records between addr answers.
authorMark Wooding <mdw@distorted.org.uk>
Tue, 10 Jun 2014 23:40:42 +0000 (00:40 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 13 Oct 2014 00:27:17 +0000 (01:27 +0100)
commitc4cb1794b6d9e70b8f265c11e1a09d7ebcba30b7
treeaf207d4bb5bb940d925421b781eaaf66184a1146
parent21249652df415d73c412a4681ea4d59a7769667f
src/types.c: Handle inconsistent CNAME records between addr answers.

It can happen, if we have multiple address queries outstanding, that
they disagree about whether the original name has a CNAME record, or
what the CNAME target is.  This needn't be a configuration error or a
server bug: the zone might have been caught during a changeover.  So we
should try to handle this situation gracefully.

We resolve this as follows.  At least one answer must have reported a
CNAME record, else there is no ambiguity.  We choose the first such
record to arrive, and commit to it, discarding other addresses already
received, if any.  We then resubmit address queries for the address
types still outstanding, but asking specifically for the CNAME target
rather than the original name.

Signed-off-by: Mark Wooding <mdw@distorted.org.uk>
src/internal.h
src/types.c