]> git.ipfire.org Git - thirdparty/systemd.git/commit
resolved: fix "in-between" logic when boundaries are equal (#7590)
authorLennart Poettering <lennart@poettering.net>
Thu, 14 Dec 2017 05:08:21 +0000 (06:08 +0100)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 14 Dec 2017 05:08:21 +0000 (14:08 +0900)
commit59f2725cc816e1c8d3bbea30a499990ade9e8653
treed7dd507f6065aa925b5b4eda103122a33aaa1df1
parent1bb8d1fce82527031cd635ee39e43ef532bb3b0f
resolved: fix "in-between" logic when boundaries are equal (#7590)

This changes dns_name_between() to deal properly with checking whether B
is between A and C if A and C are equal. Previously we simply returned
-EINVAL in this case, refusing checking. With this change we correct
behaviour: if A and C are equal, then B is "between" both if it is
different from them. That's logical, since we do < and > comparisons, not
<= and >=, and that means that anything "right of A" and "left of C"
lies in between with wrap-around at the ends. And if A and C are equal
that means everything lies between, except for A itself.

This fixes handling of domains using NSEC3 "white lies", for example the
.it TLD.

Fixes: #7421
src/shared/dns-domain.c
src/test/test-dns-domain.c