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>
Sun, 19 Oct 2014 20:09:57 +0000 (21:09 +0100)
commit1bc731c6994dda2c1ab12fb2d8261246bcbc139c
treeaf207d4bb5bb940d925421b781eaaf66184a1146
parentcdf51ff0be2d71b61dec430d08c985f20cc5dffd
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