teor [Mon, 20 Jan 2020 06:17:38 +0000 (16:17 +1000)]
config: Make clients tell dual-stack exits they prefer IPv6
Make Tor clients tell dual-stack exits that they prefer IPv6
connections.
This change is equivalent to setting the PreferIPv6 flag on
SOCKSPorts (and most other listener ports). Tor Browser has
been setting this flag for some time, and we want to remove a
client distinguisher at exits.
Also update the man page, putting all the IP flags in their
non-default forms.
When we removed obsolete consensus methods in 32695, we also
removed ROUTERSTATUS_FORMAT_NO_CONSENSUS_METHOD, so we need to
remove it from the routerstatus format tests.
teor [Mon, 20 Jan 2020 05:50:54 +0000 (15:50 +1000)]
Merge branch 'ticket20218_rebased_squashed' into ticket20218_merged
* ticket 32695 removed networkstatus_consensus_has_ipv6(),
keep that change in master.
* ticket 20218 modifies the function name and comment for
routerstatus_has_visibly_changed(), keep that change
in ticket20218_rebased_squashed.
Nick Mathewson [Thu, 9 Jan 2020 02:13:29 +0000 (21:13 -0500)]
Disable feature/dircache files when dircache module is disabled.
To make Tor still work, we define a minimal dircache_stub.c file
that defines the entry points to the module that can actually be
seen by the compiler when we're building with dircache and relay
disabled.
Nick Mathewson [Thu, 9 Jan 2020 02:32:16 +0000 (21:32 -0500)]
Move dirserv_get_routerdescs() to control_getinfo.c
This function had some XXX comments indicating (correctly) that it
was not actually used by the dirserver code, and that only the
controller still used it.
Nick Mathewson [Thu, 9 Jan 2020 02:03:20 +0000 (21:03 -0500)]
Define a "dircache" module.
For now, this module is enabled whenever the relay module is
enabled, and disabled whenever the relay module is disabled. Though
they are logically separate, the use cases for running one without
the other are rare enough that we don't really want to support
compiling them independently.
Alexander Færøy [Wed, 15 Jan 2020 23:24:18 +0000 (23:24 +0000)]
Don't escape the bridge distribution value.
We already check if there are invalid values in
check_bridge_distribution_setting() and reject the value if that is the
case. We can therefore only have strings of [A-Z] | [a-z] | [0-9] | '-'
| '_' here which is according to the directory specification.
teor [Wed, 15 Jan 2020 22:36:45 +0000 (08:36 +1000)]
add_c_file: Improve path handling and canonicalisation
* distinguish between paths relative to the top-level tor directory,
and paths relative to tor's src directory
* canonicalise paths before using them
* check that the script is run from the top-level tor directory
* check that the file is being created in tor's src directory
Alexander Færøy [Wed, 15 Jan 2020 17:21:10 +0000 (17:21 +0000)]
Make BridgeDistribution setting validator case-insensitive.
This patch makes sure that we accept values such as "nOne", "None", and
"AnY" as valid values for BridgeDistribution. We later ensure to
lower-case the values before they are forwarded to the BridgeDB.
Alexander Færøy [Wed, 15 Jan 2020 17:18:30 +0000 (17:18 +0000)]
Always escape BridgeDistribution value from torrc in descriptors.
When the BridgeDistribution value was added in commit ebab5215252f9fa810ae091c335c5ae6e619faaf the check for whether the value
contains '\n' or '\r' was added as a requirement for whether or not the
value should be escaped.
This patch removes this check and makes sure we call `escaped()` on the
value every time before we add it to a descriptor.
Nick Mathewson [Wed, 15 Jan 2020 15:30:03 +0000 (10:30 -0500)]
Tell static analyzer that having ntservice functions not exist is ok
When we made these functions exist unconditionally (as macros on
non-windows platforms), we started to get a dead-code warning on
Coverity. We now use a macro to tell coverity not to worry about
this particular dead-code instance.
Nick Mathewson [Wed, 15 Jan 2020 15:21:18 +0000 (10:21 -0500)]
compat_compiler: add a macro to prevent coverity deadcode warnings.
The POSSIBLE(e) macro evaluates to the value of (e), but does so in
a way that a static analyzer will not conclude that (e) is
impossible. We can use this when we expect our regular compilers to
eliminate deadcode, but we don't want coverity to complain about it.
teor [Wed, 15 Jan 2020 02:22:38 +0000 (12:22 +1000)]
scripts/git: Fix git-merge-forward after removing 0.2.9
We need a test branch for the earliest maint branch (maint-0.3.5),
but we can't merge forward into it, because there is no previous
active maint branch.
Also, edit a git-push-all comment that still said "029".
Bugfix on 32772; bug not in any released version of tor.
David Goulet [Tue, 7 Jan 2020 20:03:24 +0000 (15:03 -0500)]
chan: Remove dead var cell handler from channel_t
The variable lenght cells are handled directly by
channel_tls_handle_var_cell() from an OR connection reading its inbuf. The
channel var cell handler (agnostic) was never used.
Closes #32892
Signed-off-by: David Goulet <dgoulet@torproject.org>
Nick Mathewson [Tue, 14 Jan 2020 18:16:39 +0000 (13:16 -0500)]
Replace an assertion with a check-and-log
We hit this assertion with bug 32868, but I'm stymied figuring out
how we wound up with a routerstatus like this. This patch is a
diagnostic to attempt to figure out what is going on, and to avoid a
crash in the meantime.