chiark / gitweb /
src/setup.c: Check netmask more carefully.
authorMark Wooding <mdw@distorted.org.uk>
Sat, 3 May 2014 14:35:29 +0000 (15:35 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Mon, 9 Jun 2014 19:58:07 +0000 (20:58 +0100)
commit95bee3e1cb676e462750a8c46cf6439a3e3e6cc0
tree6cc5d2d7c3a215edff10c5f0e7837f21ff4e8653
parent34ed308d7ecb3562c5da4c1941e59e7228847398
src/setup.c: Check netmask more carefully.

[crybaby ~/src/adns/build]RES_CONF_TEXT="sortlist 172.29.199.1/24" RES_OPTIONS="adns_checkc:entex" adnshost -ta www-cache.distorted.org.uk
adnshost: ../src/check.c:83: checkc_global: Assertion `!(ads->sortlist[i].base.s_addr & ~ads->sortlist[i].mask.s_addr)' failed.
Aborted

Unfortunately, `ccf_sortlist' only checked that the free bits of the
network address are clear when given a general netmask, so if you give a
prefix length or leave it implicit then you hit a consistency check
failure later.

Check the mask later on, after all of the variants are handled.  There's
a little bit of variation in the message.

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