Commit Graph

26190 Commits

Author SHA1 Message Date
David Goulet
79d6127a47 trace: Comments and improve doc/HACKING/Tracing.md
Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-08 09:12:36 -04:00
David Goulet
c8f632784b trace: Add two circuit tracepoints for new circuits
Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-08 09:10:30 -04:00
David Goulet
4cb6887471 trace: Add two origin circuit specific tracepoints
Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-08 09:10:30 -04:00
David Goulet
d36a44ffa9 trace: Add four generic circuit tracepoints
Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-08 09:10:29 -04:00
David Goulet
a706334577 trace: Add four more circuit subsystem tracepoints
Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-08 09:10:08 -04:00
David Goulet
bf0e2ae0d0 trace: Add single tracepoint in circuit subsystem
This is the very first tracepoint in tor. It is in the circuit subsystem for
when a new circuit opens.

LTTng instrumentation requires lot more around a tracepoint than USDT thus
this commit only adds one tracepoint in order to outline a base to add more
tracepoints later.

The idea is that we separate subsystem into what LTTng defines as "providers"
so the circuit provider contains the tracepoint definitions for the circuit
subsystem.

Signed-off-by: David Goulet <dgoulet@torproject.org>

Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-08 09:10:08 -04:00
David Goulet
c31d469f37 trace: Comments and configure fix
Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-08 09:10:08 -04:00
David Goulet
0de543aae6 trace: Add LTTng-UST interface support
No probes at this point. They are per subsystem and thus in later commits.

Part of #32910
2020-07-08 09:10:08 -04:00
David Goulet
668fc70a20 trace: Add USDT probes generation support
This commit adds both configure options and probe generation for tracepoints.

Part of #32910

Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-08 09:10:08 -04:00
David Goulet
70f031528d trace: Hook lib/trace as a subsystem
Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-08 09:10:08 -04:00
David Goulet
6fc6cbd9b3 trace: Better structure lib/trace and configure options
In the next commits, we'll add more tracing options for instrumentation and
specific tracer.

This rename follows a more meaningful naming standard. It also adds a catch
all "HAVE_TRACING" define that indicate in the code that we have tracing
enabled.

Part of #32910

Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-08 09:10:08 -04:00
Alexander Færøy
e4bfa734a6 Merge branch 'maint-0.4.4' 2020-07-08 00:36:48 +00:00
Alexander Færøy
9603d8af0b Merge branch 'maint-0.4.3' into maint-0.4.4 2020-07-08 00:36:48 +00:00
Alexander Færøy
c364e0e83b Merge branch 'maint-0.4.2' into maint-0.4.3 2020-07-08 00:36:48 +00:00
Alexander Færøy
b81e24cda6 Merge branch 'maint-0.3.5' into maint-0.4.2 2020-07-08 00:36:47 +00:00
Nick Mathewson
3e08dd9df1 Resolve a compiler warning from a 32-bit signed/unsigned comparison
This warning only affects platforms (like win32) with 32-bit time_t.

Fixes bug 40028; bugfix on 0.3.2.8-rc.
2020-07-07 15:05:38 -04:00
Nick Mathewson
9e33391ebb Merge remote-tracking branch 'tor-github/pr/1974/head' 2020-07-07 11:08:20 -04:00
David Goulet
809c864707 addr: Attempt to learn our address with ORPort
If no Address statement are found in the configuration file, attempt to learn
our address by looking at the ORPort address if any. Specifying an address is
optional so if we can't find one, it is fine, we move on to the next discovery
mechanism.

Note that specifying a hostname on the ORPort is not yet supported at this
commit.

Closes #33236

Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-07 10:52:43 -04:00
Nick Mathewson
2aa5e95f58 Fix coccinelle complaint in test-memwipe.c 2020-07-07 15:33:35 +03:00
George Kadianakis
118c35b55b Mark some log messages as used by Chutney. 2020-07-07 12:45:29 +03:00
Nick Mathewson
1ee748e4ca Fix coccinelle complaint in test_config.c 2020-07-06 15:17:47 -04:00
David Goulet
95fc085bf3 addr: Fix possible memleak in find_my_address()
Unit tests also suffered from a memleak.

Closes #40024

Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-06 11:21:41 -04:00
Nick Mathewson
ac3bc88343 Merge remote-tracking branch 'tor-github/pr/1938/head' 2020-07-06 09:34:13 -04:00
George Kadianakis
00f921edb9 Merge branch 'maint-0.4.4' 2020-07-03 15:54:41 +03:00
George Kadianakis
05ca50c9a3 Merge branch 'tor-github/pr/1962' into maint-0.4.4 2020-07-03 15:54:24 +03:00
David Goulet
6ff4596753 hs-v2: Add deprecation warning for service
If at least one service is configured as a version 2, a log warning is emitted
once and only once.

Closes #40003

Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-03 15:52:54 +03:00
George Kadianakis
3bb9b7e743 Merge branch 'tor-github/pr/1934' 2020-07-03 10:50:47 +03:00
David Goulet
064e23e95c Merge branch 'tor-github/pr/1968' 2020-07-02 14:18:00 -04:00
Nick Mathewson
c5707d6cf0 Add braces to IF_BUG_ONCE()s introduced in ticket34069. 2020-07-02 14:17:51 -04:00
Nick Mathewson
873d6d3724 Clean up a redundant debug log in circuit_handle_first_hop().
We don't need to log that we're about to look for a channel for a
given extend_info_t, since we're either going to log that we're
launching one (at info), or that we're using an existing one (at
debug).
2020-07-02 14:17:51 -04:00
Nick Mathewson
e93ad428e2 Allow multiple addresses in extend_info_t.
In practice, there will be at most one ipv4 address and ipv6 address
for now, but this code is designed to not care which address is
which until forced to do so.

This patch does not yet actually create extend_info_t objects with
multiple addresses.

Closes #34069.
2020-07-02 14:17:51 -04:00
Nick Mathewson
b0a716dfb0 Move description of ext contents into an md file.
This way, doxygen can include it.
2020-07-02 13:46:25 -04:00
Nick Mathewson
fbf8bda30b Mention that src/ext should not be edited lightly.
Closes #32661
2020-07-02 13:38:17 -04:00
Nick Mathewson
a34b9a0b62 Merge branch 'ticket33238_045_01_squashed' 2020-07-02 11:00:48 -04:00
David Goulet
45afb31e1c addr: Prioritize interface lookup over local hostname
The find_my_address() function now prioritize the local interface over the
local hostname when guessing the IP address.

See proposal 312, section 3.2.1, general case:
https://gitweb.torproject.org/torspec.git/tree/proposals/312-relay-auto-ipv6-addr.txt#n359

The entire unit tests had to be refactored to make this possible. Instead of
hot patching it, it has been rewritten to cover all possible cases and the
test interface has been changed to accomodate both IPv4 and IPv6 in order for
them to be tested identically.

Closes #33238

Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-02 11:00:42 -04:00
Nick Mathewson
2e98e88117 Merge branch 'maint-0.4.4' 2020-07-02 10:15:04 -04:00
Nick Mathewson
18fa53fdf4 Merge branch 'ticket32622_044_squashed' into maint-0.4.4 2020-07-02 10:14:55 -04:00
Nick Mathewson
7b5f58a1c9 Carry TLS error strings forward to controller when reporting them.
Now instead of saying "DONE, DONE" or "MISC, MISC" or "TLS_ERROR,
TLS_ERROR",  we can finally give a nice sensible "TLS_ERROR,
wrong version number" which should help debug a great deal.

Closes ticket 32622.
2020-07-02 10:14:48 -04:00
Nick Mathewson
cca3164f8d Add a convenience function to check for unspec address. 2020-07-02 09:51:04 -04:00
Nick Mathewson
1e97f96888 Refactor channel_connect_for_circuit() to take an extend_info_t. 2020-07-02 09:51:04 -04:00
Nick Mathewson
6a0b9e4746 Allow null ID argument to extend_info_new. 2020-07-02 09:51:04 -04:00
Nick Mathewson
ad71303f5f Remove an untrue comment in extend_cell_t 2020-07-02 09:51:04 -04:00
Nick Mathewson
81d312f12c Add a function for comparing the orport on an extendinfo. 2020-07-02 09:51:03 -04:00
Nick Mathewson
8f362b7bce Extract extend_info manipulation functions into a new file. 2020-07-02 09:51:03 -04:00
Nick Mathewson
56e33f73f1 Light edits to extend_info_t docs 2020-07-02 09:51:03 -04:00
Nick Mathewson
20d1a1cdbd Merge remote-tracking branch 'dgoulet/ticket32822_045_01' 2020-07-02 09:47:43 -04:00
David Goulet
9b560ea714 Merge branch 'maint-0.4.4' 2020-07-02 07:20:58 -04:00
David Goulet
8da10e8237 Merge branch 'maint-0.4.3' into maint-0.4.4 2020-07-02 07:20:58 -04:00
David Goulet
5a5ff3d8c5 Merge branch 'maint-0.4.2' into maint-0.4.3 2020-07-02 07:20:57 -04:00
David Goulet
07d8d398ca Merge branch 'maint-0.3.5' into maint-0.4.2 2020-07-02 07:20:57 -04:00