]> git.ipfire.org Git - thirdparty/knot-resolver.git/commit
kr_ranked_rrarray*: avoid duplicate RRsets on wire
authorVladimír Čunát <vladimir.cunat@nic.cz>
Tue, 30 May 2017 16:31:10 +0000 (18:31 +0200)
committerVladimír Čunát <vladimir.cunat@nic.cz>
Thu, 1 Jun 2017 14:21:23 +0000 (16:21 +0200)
commit8d79b5178a6f3b30b6400ff97098aeb52e42a701
treeac1c8571f67803f69102d7ae9500df1cd35ea03f
parent4fa31008076a4a43c914c3c944dd1b45e72c3bcf
kr_ranked_rrarray*: avoid duplicate RRsets on wire

Fixes https://gitlab.labs.nic.cz/knot/resolver/issues/198.
We can't let multiple "matching RRsets" to the wire, and we can't just
merge the sets from multiple queries either.  The only way is to choose
either of the sets and put it on the wire.  ATM the last one wins.

Common ocurrence of the bug: if www.example.cz was a CNAME for example.cz
and we ask for a non-existent type, we would get the SOA record twice
in the final answer.

A few related changes:
 - don't just assert, also return error code if -DNDEBUG
 - kr_ranked_rrarray_set_wire: don't do full-content comparison anymore;
   see the first paragraph in this commit message for the reasons
 - minor refactoring of that code, more comments, etc.
NEWS
lib/utils.c
lib/utils.h