chiark / gitweb /
Ian Jackson [Wed, 28 Jan 2015 23:48:58 +0000 (23:48 +0000)]
regress: Add some tests with ~adns_if_noautosys
The test harness provides adns_if_noautosys by default (to make the
test .sys files more readable and less noisy, mostly).
But adns behaves rather differently with noautosys. We should have
some more tests without it. (The invocations of adnstest implied by
these new test cases produce obviously-wrong behaviour with an adns
which is lacking the TCP async connect API fix.)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Sat, 21 Feb 2015 11:33:14 +0000 (11:33 +0000)]
regress: Remove update-extra-select conversion script
This script was a one-off.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Wed, 28 Jan 2015 23:17:03 +0000 (23:17 +0000)]
Portability: Fix assumption about read() and write() on connecting sockets
Without adns_if_noautosys, adns would attempt read() on its TCP client
socket immediately after getting EINPROGRESS from connect(), and
assume that EAGAIN/EWOULDBLOCK means the socket is connected.
This is actually not correct on any platform that I'm aware of.
However, on Linux, write() on a socket which is being connected
returns EAGAIN, so everything seemed to work - adns would think that
the socket's window was full and wait for it to become writeable. On
many other platforms, write() on such a socket returns ENOTCONN.
The result is that adns's TCP support may fail to work properly on
such platforms, especially if the nameserver is not localhost. (A
connect to a suitable server on localhost often completes immediately,
which avoids exposing the bug.) adns might fail to be able to do TCP
at all.
We detect the completion (successful or otherwise) of connect() by
selecting the fd (as contemplated by SuS). This might expose us to
spurious fd writeability indications, if such things exist, but the
nonblocking connect API demands that they don't at least in this case.
We always do this select check, in adns_processwriteable. In theory
this is sometimes unnecessary, because adns_processwriteable's caller
has probably just got a writeability indication from poll or select.
But adns should not assume that its caller will never feed it spurious
events, and there seems little point optimising away one syscall per
tcp connection (given that adns reuses the connection where possible.)
This behaviour naturally causes a lot of the regression tests to fail.
So in this commit we also update all the regression tests. This has
been done in a programmatic way, by running
perl -i ./update-extra-select case-*.sys
update-extra-select is supplied in this commit. It is a (hopefully
easy to understand) script which adds a select just before every
applicable read. The pretended select always reports that the fd is
useable, which is what would justify adns's subsequent behaviour.
(Most of the tests run with adns_if_noautosys - since that's the
default and has to be toggled off - and in those cases the socket has
in any case just been reported as writeable.)
Note that regress/update-extra-select is not idempotent. Here, it has
been used exactly once. (It is going to be deleted again in the next
commit.)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Wed, 28 Jan 2015 23:49:19 +0000 (23:49 +0000)]
regress: Support NULL fdset arguments to select
We are going to want to pass these, and currently the test harness
will dereference the NULL. So fix this.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Wed, 10 Dec 2014 23:16:37 +0000 (23:16 +0000)]
Fix for malicious optimisation of memcpy in test suite, which causes failure with gcc-4.1.9 -O3. See Debian bug #772718.
Ian Jackson [Sun, 2 Nov 2014 23:15:52 +0000 (23:15 +0000)]
Portability fix for systems where socklen_t is bigger than int.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Sun, 2 Nov 2014 19:22:46 +0000 (19:22 +0000)]
Clarify licence in NEWS
Ian Jackson [Sun, 2 Nov 2014 19:22:26 +0000 (19:22 +0000)]
Start 1.5.1~~
Ian Jackson [Sun, 2 Nov 2014 15:00:56 +0000 (15:00 +0000)]
Release 1.5.0. No changes since 1.5.0~rc1.
Ian Jackson [Sun, 26 Oct 2014 14:58:21 +0000 (14:58 +0000)]
Merge branch 'master' of chiark:public-git/adns
Ian Jackson [Sun, 26 Oct 2014 14:57:58 +0000 (14:57 +0000)]
RELEASE-CHECKLIST: Updates used during release of 1.5.0~rc1
Ian Jackson [Sun, 26 Oct 2014 14:57:37 +0000 (14:57 +0000)]
Update versions for ongoing development
Ian Jackson [Sun, 26 Oct 2014 13:25:14 +0000 (13:25 +0000)]
Finalise 1.5.0~rc1
Ian Jackson [Sun, 26 Oct 2014 13:21:16 +0000 (13:21 +0000)]
NEWS, changelog: Documentation for 1.5.0~rc1
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Sun, 26 Oct 2014 11:58:09 +0000 (11:58 +0000)]
regress/Makefile.in: Parallelise `make check'
Use an individual target for each test. This allows parallel make to
get its teeth into the problem.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Sun, 26 Oct 2014 11:29:47 +0000 (11:29 +0000)]
resolv.conf parsing: Test adns_af:dampstring
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Sun, 26 Oct 2014 11:28:56 +0000 (11:28 +0000)]
resolv.conf parsing: Treat unknown adns_af: values correctly
These shouldn't be fatal, and they should be affected by
ads->config_report_unknown.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Sun, 26 Oct 2014 11:22:00 +0000 (11:22 +0000)]
resolv.conf option parsing: Test adns_checkc
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Sun, 26 Oct 2014 11:30:36 +0000 (11:30 +0000)]
resolv.conf parsing: Rename OPTION_IS etc. to WORD_IS
This now handles whatever is in `word', not necessarily the whole
option. (We do this rename in a separate patch as it makes the
previous patch easier to review.)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Sun, 26 Oct 2014 11:06:09 +0000 (11:06 +0000)]
resolv.conf option parsing: Fix word separation
`nextword' does not nul-terminate the words it returns. So the
strcmps in ccf_options are wrong. Fix this as follows:
* Abolish most uses of l in favour of a pointer variable endword.
* Have OPTION_IS and OPTION_STARTS update word, and endword, so
that it is convenient to use them for option values, etc.
* Save the whole option in new variables opt and optend for
reporting and to assist the `adns_af:' loop.
* Use OPTION_IS, OPTION_STARTS and memchr, rather than strcmp,
ad-hoc memcmp, and strcspn.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Sat, 25 Oct 2014 22:01:50 +0000 (23:01 +0100)]
RELEASE-CHECKLIST: Check that tarball is equal to git tree
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Sat, 25 Oct 2014 21:04:49 +0000 (22:04 +0100)]
RELEASE-CHECKLIST: Non-real mode (the default, now)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Sat, 25 Oct 2014 21:04:22 +0000 (22:04 +0100)]
RELEASE-CHECKLIST: Require version argument
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Fri, 24 Oct 2014 21:12:33 +0000 (22:12 +0100)]
Config parsing: Provide a way to ignore unknown resolv.conf contents
You can now set the option `adns_ignoreunkcfg'. This is relevant to
Debian #411263.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Fri, 24 Oct 2014 21:03:50 +0000 (22:03 +0100)]
Config parsing: Ignore some BIND9-specific resolv.conf options
Debian #411263. I also read wheezy's resolv.conf(5).
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Fri, 24 Oct 2014 20:49:44 +0000 (21:49 +0100)]
resolv.conf parser: Avoid duplicating lengths in option parser
Replace a lot of things like `l>=5 && memcmp(word,"debug",5)'
with use of some new macros.
No functional change.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Fri, 24 Oct 2014 20:36:36 +0000 (21:36 +0100)]
API: Reject unknown flags
Check for unknown flags in adns_initflags, adns_queryflags, and
adns_rrtype.
This will allow us to extend the API in the future but still retain
backward-ABI-safety: new applications which pass a new flag but are
run against old adns will get an error (typically, ENOSYS).
In each case we reserve a few of the spare bits for `harmless'
extensions: flags which we decide, at the time of introduction, that
it is harmless for old implementations to ignore.
We simply provide explicit hex values for the flags. This is easier
than listing all of the actually-defined flags, and probably no less
reliable. Failing to add a new flag to the check as well as to the
enum will produce an obvious error (unless the `harmless' flag is used
- and those are at the top of the space to reduce that probability).
In the case of adns_rrtype, all of the external functions quickly pass
the type to adns__findtype, so we can do the check there.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Fri, 24 Oct 2014 18:02:30 +0000 (19:02 +0100)]
Make internal function vbuf__append_quoted1035 static
This does not change the library ABI - the only callers are internal.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Fri, 24 Oct 2014 18:00:32 +0000 (19:00 +0100)]
Remove RCSids.
We are using git now and it doesn't do this kind of thing. They are a
pain, anyway.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Mon, 20 Oct 2014 16:03:42 +0000 (17:03 +0100)]
Build system: Add test case output and common.make to `make [dist]clean'.
(Cherry-picked from Debian's adns dgit/experimental branch.)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Mon, 20 Oct 2014 15:34:52 +0000 (16:34 +0100)]
Build system: Bodge regress/Makefile.in's .SECONDARY some more
The declaration mentioning CLIENTS has an unfortunate side-effect: it
`mentions' the file adnshost_c.o, which is not part of the build and
is not buildable.
According to the rules in `(make)Implicit Rule Search' this causes
make to try to build adnshost_playback from adnshost_c.o (rule 5).
This is because files whose names are `mentioned' are taken to `ought
to exist'.
This causes adns to be unbuildable on the make from Debian sid
(4.0-8); it is not visible on earlier makes (eg 3.81-8.2) because they
don't appear to actually follow the documented algorithm.
Bodge this (further) by filtering adnshost out of the client list. It
is currently the only client made out of multiple object files.
(Cherry-picked from Debian's adns dgit/experimental branch.)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Fri, 24 Oct 2014 17:53:02 +0000 (18:53 +0100)]
regress: Use new combined hex syntax for adnstest types
This makes the tests clearer to read. No functional change.
Change was made with
for f in regress/*.sys; do perl -i~ -p ../t.pl $f; done
where t.pl is this script
if ($.==1) { $at=m{^(?:\./)?adnstest\b}; }
if ($at && $.==2 && m/^:/) {
m/^:(\S+)/ or die;
$r=$'; #';
$_=$1;
s{\b(\d+)\b}{
sprintf "0x%x|%d", ($1 & ~0xffff), ($1 & 0xffff)
}ge;
$_=":$_$r";
}
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Fri, 24 Oct 2014 17:43:51 +0000 (18:43 +0100)]
adnstest: Support typenum being 0xXX|DDD
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Thu, 23 Oct 2014 19:31:48 +0000 (20:31 +0100)]
API: Provide adns_qf_cname_strict
In the medium term we want to make adns tolerate cname chains better.
One thing we want to do is to change the default to be
adns_qf_cname_loose.
So introduce a flag now that allows applications to explicitly request
strict. For now this new flag has no effect.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Thu, 23 Oct 2014 19:02:59 +0000 (20:02 +0100)]
enums: Add `sizeforce' member value
The C standard helpfully permits enums with a small range of values to
be short. This effect is not desirable in an API because it means that
adding new values (new flags, say) may cause ABI incompatibility.
Add some `sizeforce' members to relevant enums in the API. In none of
the three cases do we expect this to actually cause an ABI break on
actual practical platforms, because the values we choose are within
the same power-of-two bitwidth.
Specifically:
max value in adns 1.4 new max value
adns_initflags 0x0300 0x7fff
adns_queryflags 0x0ff00000 0x7fffffff
adns_rrtype 0x20000 0x7fffffff
adns_status 499 unchanged
The small max value of adns_initflags is unfortunate. But we can't
change it without actually breaking the ABI on actual existing
platforms. We can put off biting that bullet until we run out of
initflags - there are still three flags remaining.
This patch is not expected to have any practical effect with existing
platforms and compilers but it makes the code more correct and less
likely to be misoptimised by a future aggressive compiler.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Mon, 20 Oct 2014 01:32:04 +0000 (02:32 +0100)]
.gitignore: Ignore GPG signature
Ian Jackson [Mon, 20 Oct 2014 01:31:46 +0000 (02:31 +0100)]
Update version numbers to be between releases
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Mon, 20 Oct 2014 01:32:44 +0000 (02:32 +0100)]
RELEASE-CHECKLIST: Say to update versions after doing release
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Mon, 20 Oct 2014 01:30:36 +0000 (02:30 +0100)]
RELEASE-CHECKLIST: wip, as used for 1.5.0~rc0
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Mon, 20 Oct 2014 01:10:31 +0000 (02:10 +0100)]
README.html: Web page management changes
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Mon, 20 Oct 2014 00:37:40 +0000 (01:37 +0100)]
Versions: update to 1.5.0 RC0
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Mon, 20 Oct 2014 00:28:07 +0000 (01:28 +0100)]
NEWS: More updates
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Mon, 20 Oct 2014 00:26:31 +0000 (01:26 +0100)]
NEWS: Remove "pleased to announce" - should be in mail
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Mon, 20 Oct 2014 00:25:44 +0000 (01:25 +0100)]
README.html: Abolish dead link to BIND
Ian Jackson [Mon, 20 Oct 2014 00:25:27 +0000 (01:25 +0100)]
README.html: mention signatures as possibly being on the web page
Ian Jackson [Mon, 20 Oct 2014 00:24:22 +0000 (01:24 +0100)]
Build system: Provide `web-install' target
This copies the various website files to WEBDIR.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Mon, 20 Oct 2014 00:22:36 +0000 (01:22 +0100)]
adns.h: Generalise some mentions of A RRs.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Mon, 20 Oct 2014 00:22:07 +0000 (01:22 +0100)]
Build system: Break out common.make[.in]
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Mon, 20 Oct 2014 00:09:29 +0000 (01:09 +0100)]
Build system: Know how to build adnshost.txt
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Sun, 19 Oct 2014 23:57:17 +0000 (00:57 +0100)]
changelog: Reorder slightly
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Sun, 19 Oct 2014 23:38:40 +0000 (00:38 +0100)]
Build system: Do not include Makefile and src/config.h in distribution tarball
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Sun, 19 Oct 2014 23:29:32 +0000 (00:29 +0100)]
changelog: More updates
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Sun, 19 Oct 2014 23:29:24 +0000 (00:29 +0100)]
NEWS: Draft release notes for 1.5.0~rc0
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Sun, 19 Oct 2014 23:15:15 +0000 (00:15 +0100)]
.gitignore: Add autom4te.cache
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Sun, 19 Oct 2014 23:14:18 +0000 (00:14 +0100)]
Build system: update configure to autoconf 2.69
Ran `configure' on Debian wheezy i386.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Sun, 19 Oct 2014 23:11:10 +0000 (00:11 +0100)]
Licensing: Abolish `proprietary' part in GPL-vs-LGPL
Having accepted substantial contributions I am no longer in a position
to offer this. And anyway the offer was mostly there to put people
off asking for something for nothing - no-one actually ever offered me
money.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Sun, 19 Oct 2014 23:10:25 +0000 (00:10 +0100)]
Licensing: Abolish LICENCE.WAIVERS
The only existing waiver was for the AGPL, and the GPLv3 which we are
now using has an AGPL-compatibility clause already in it.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Sun, 19 Oct 2014 23:07:19 +0000 (00:07 +0100)]
Licensing: Add copyright for Mark Wooding
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Sun, 19 Oct 2014 23:06:42 +0000 (00:06 +0100)]
Licensing: Update copyright dates for Ian Jackson
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Sun, 19 Oct 2014 23:02:48 +0000 (00:02 +0100)]
Licensing: Delete FSF address from INSTALL
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Sun, 19 Oct 2014 23:01:59 +0000 (00:01 +0100)]
Licensing: Copy GPL-3 into COPYING
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Sun, 19 Oct 2014 23:00:55 +0000 (00:00 +0100)]
Licensing: Delete FSF street address
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Sun, 19 Oct 2014 22:58:22 +0000 (23:58 +0100)]
Licensing: Update version in file header comments
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Sun, 19 Oct 2014 22:53:03 +0000 (23:53 +0100)]
changelog: Update with changes so far
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Sun, 19 Oct 2014 22:50:34 +0000 (23:50 +0100)]
Remove cvs-to-git conversion script
This has now done its work and is no longer needed.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Sun, 19 Oct 2014 22:39:44 +0000 (23:39 +0100)]
Makefile.in: Fix "make dist" for git
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Sun, 19 Oct 2014 22:36:57 +0000 (23:36 +0100)]
Documentation and webpage updates
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Sun, 19 Oct 2014 22:35:32 +0000 (23:35 +0100)]
Makefile.in: update DISTVERSION
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Mon, 13 Oct 2014 12:54:35 +0000 (13:54 +0100)]
src/types.c: Clarify comment for addr_submit (style)
We don't just fiddle with tinfo; this function actually sets it.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Mon, 13 Oct 2014 12:50:47 +0000 (13:50 +0100)]
src/types.c: Rewrite pap_addr (style)
Completely rework this function to make it much clearer. Also rename
many of the surviving variables.
No functional change.
The following rune was helpful to me when preparing this patch:
diff -bu <(git-show HEAD:src/types.c | perl -pe 's/\bstoreto\b/out/g; s/\bmax\b/cbyte_max/g; s/\boaddr\b/use_addr/; s/\bsalen\b/out_salen/g; s/\bstep\b/in_addrlen/g; s/\baf\b/out_af/g; s/\brrsz\b/out_rrsz/g; s/\brrty\b/in_rrty/g') src/types.c |less +/pap_addr
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Mon, 13 Oct 2014 12:09:03 +0000 (13:09 +0100)]
src/types.c: Clarify gettimeofday error handling (style)
Use `r=...; if (r)...' rather than `if (syscall) ...'. And add a
comment explaining why we're not using adns__must_gettimeofday.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Sun, 12 Oct 2014 19:34:42 +0000 (20:34 +0100)]
src/types.c: Clarify addr_rrtypeflag loop (style)
This structure avoids repeating the loop termination condition.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Sun, 12 Oct 2014 19:20:39 +0000 (20:20 +0100)]
src/types.c: Rename `hunoz' (style)
Call this `addr__rrty_eat_final_comma', not `addr_rrty_hunoz' (which
AFAICT from web searches is meaningful to Lisp programmers).
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Sun, 12 Oct 2014 19:11:23 +0000 (20:11 +0100)]
src/query.c: adns__free_interim: Add assertion
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Sun, 12 Oct 2014 19:10:02 +0000 (20:10 +0100)]
src/query.c: Rename alloc_info (style)
Rename it to alloc__info to emphasize its privateness.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Sun, 12 Oct 2014 19:02:27 +0000 (20:02 +0100)]
src/event.c: Use `continue' in adns_processreadable (style)
This is IMO clearer than another nested indent of the bulk of the loop
body.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Sun, 12 Oct 2014 18:41:52 +0000 (19:41 +0100)]
src/setup.c: Reuse variable i (style)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Sun, 12 Oct 2014 17:00:35 +0000 (18:00 +0100)]
src/: Rename `udpsocket' and `nudp' (style)
I prefer plurals for arrays and the count should have a near-identical
name.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Sun, 12 Oct 2014 16:17:23 +0000 (17:17 +0100)]
Makefiles: Remove pipes on clean
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Sun, 12 Oct 2014 16:16:32 +0000 (17:16 +0100)]
regress/: Replace PF_ with AF_
I don't much like PF_. None of the modern specs or docs talk about PF
any more.
Entirely formulaic patch:
perl -i~ -pe 's/\bPF_INET\b/AF_INET/g' regress/*
perl -i~ -pe 's/\bPF_INET6\b/AF_INET6/g' regress/*
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Sun, 12 Oct 2014 14:36:11 +0000 (15:36 +0100)]
src/: Fix commentary mood (style)
I prefer `/* does X */', to `/* do X */', for the comment next to a
function which does X.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Sun, 12 Oct 2014 14:29:13 +0000 (15:29 +0100)]
src/: Rename a variable `n' to `salen' (style)
I don't think a length can be called `n'.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Sun, 12 Oct 2014 14:25:25 +0000 (15:25 +0100)]
src/: Add a missing space (style)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Sun, 12 Oct 2014 14:08:14 +0000 (15:08 +0100)]
src/: Clarify logic in clk_srv (style)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Sun, 12 Oct 2014 14:00:51 +0000 (15:00 +0100)]
src/: Rename some variables `stat' to `st' (style)
These inconsistencies have been there since the dawn of time.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Sun, 12 Oct 2014 13:57:28 +0000 (14:57 +0100)]
src/: Rename a variable `err' to `st' (style)
(This was introduced in `src/: Change how query domain names are
checked.' and I prefer this name.)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Sat, 26 Jul 2014 13:56:17 +0000 (14:56 +0100)]
regress/Makefile.in: Declare <client>_c.o as .SECONDARY
Otherwise you can get this:
regress$ make adnstest_record -j2
gcc -g -O2 -Wall -Wmissing-prototypes -Wwrite-strings -Wstrict-prototypes -Wcast-qual -Wpointer-arith -Wno-pointer-sign -I../src -I. -I./../src -DADNS_REGRESS_TEST -I. -c -g -o addrfam_d.o ../src/addrfam.c
gcc adnstest_c.o hrecord.o hcommon.o types_d.o event_d.o query_d.o reply_d.o general_d.o setup_d.o transmit_d.o parse_d.o poll_d.o check_d.o addrfam_d.o -o adnstest_record
gcc: error: adnstest_c.o: No such file or directory
make: *** [adnstest_record] Error 1
regress$
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Thu, 24 Jul 2014 00:22:54 +0000 (01:22 +0100)]
reverse parsing: New test cases
Check that the reverse parser rejects labels with leading zeroes, with
digits out of range, or with out-of-range label values. And check
uppercase IPv6 PTRs.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Thu, 24 Jul 2014 00:02:54 +0000 (01:02 +0100)]
reverse parsing: Clearer algorithm
We used to have a kind of open-coded coroutine arrangement for parsing
reverse domains. This is complicated and confusing.
Instead, when "parsing" the labels, simply stash their locations and
lengths. Then, at the end, we have all of the information needed to
check, parse and process the whole domain.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Wed, 23 Jul 2014 22:18:56 +0000 (23:18 +0100)]
reverse parsing: Make adns__revparse_* return bool
This seems nicer and is going to be more convenient.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Wed, 23 Jul 2014 21:58:03 +0000 (22:58 +0100)]
reverse parsing: Pass dgram and labstart instead of label
We are going to want to deal with labstart and dgram separately.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Thu, 24 Jul 2014 00:46:09 +0000 (01:46 +0100)]
Introduce adns__labels_equal and ctype_toupper
This not only makes adns__findrr_anychk less confusing, but it also
makes it possible to reuse this functionality.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Wed, 23 Jul 2014 23:52:51 +0000 (00:52 +0100)]
regress/gdbwrap: Provide a convenience script
This lets you run gdb from within r1test with appropriate fd plumbing.
(It's a shame gdb doesn't have a way to simply tell it to take its
commands from /dev/tty.)
Add the suggested example gdb script file, x.gdb, to .gitignore.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Sat, 19 Jul 2014 18:55:39 +0000 (19:55 +0100)]
regress: New test bogus-sortlist
Exercise the code which checks the sortlist for invalid address/mask
pairs.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Sat, 19 Jul 2014 16:39:46 +0000 (17:39 +0100)]
addrfam: Make SIN, SIN6 more regular
Abolish CSIN and CSIN6. Instead, provide a first argument which may
be `const' or empty. (Empty macro arguments are permitted since C99.)
This makes them useable in SOCKADDR_IN_IN6*, so use them there.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Sat, 19 Jul 2014 16:37:37 +0000 (17:37 +0100)]
addrfam: Introduce SOCKADDR_IN_IN6, etc.
These macros make writing IPv4/IPv6 handling functions convenient.
Use them everywhere applicable.
This replaces AF_CASES, which was longwinded (and also error-prone,
since it is possible to pass a different af to switch() and
unknown_af()).
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Sat, 12 Jul 2014 11:56:46 +0000 (12:56 +0100)]
addrfam: New arrangements for protocol address types
Abolish union gen_addr and struct af_addr. It is not legitimate to
up-cast to a union (since the alignment might be wrong), and the
profusion of additonal address types is confusing.
The new arrangements are:
* Use adns_sockaddr wherever we can. That includes situations
where the port (or v6 scope, etc.) is not relevant.
* Where that's not possible, use a struct sockaddr if we can.
* Where we need to deal with an IP address of unspecified family (we
use the phrase `protocol address') we must use a void*.
Other changes we make here:
* Reorganise the set of functions provided by addrfam.c. Previously
there was a comprehensive set of manipulators. Now, we have
precisely the set of functions we need.
The new functions are called adns__addr_* when they deal with
adns_sockaddrs, and adns_sockaddr_* when dealing with struct
sockaddrs.
The new functions normally no longer need to take an explicit af
parameter, since they can use the af field in the sockaddr.
* adns__sockaddrs_equal (previously, adns__sockaddr_equal_p) now uses
the generic protocol address comparison function; consequently
remove the IN6_ADDR_EQUALP macro since it now has only one use site.
* Remove the Lispy "-p" suffix from predicate function names.
And of course the very formulaic changes to code which accesses
addresses of various kinds.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Sat, 19 Jul 2014 15:10:46 +0000 (16:10 +0100)]
addrfam: mark unknown_af as not returning
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Ian Jackson [Sat, 19 Jul 2014 14:55:30 +0000 (15:55 +0100)]
.gitignore: add addrtext_s, remove non-built dynamic local tests
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Mark Wooding [Wed, 11 Jun 2014 00:02:49 +0000 (01:02 +0100)]
Support IPv6 in addr queries.
This is the end-game. Add flags and options to allow clients and
administrators to choose which address families they want returned. For
logical compatibility with old clients, don't return foreign address
families unless explicitly requested.
Lots of tests are modified to select only IPv4 addresses. There's
nothing else up my sleeve. A new test is added for the additional
functionality; more are expected later.
Signed-off-by: Mark Wooding <mdw@distorted.org.uk>
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>