Commit Graph

36189 Commits

Author SHA1 Message Date
Alexander Færøy
623af0155e Update docstring for read_file_to_str() on stripping of CR characters.
See: https://bugs.torproject.org/tpo/core/tor/33781
2020-07-14 17:41:59 +00:00
Alexander Færøy
abe7196c53 Strip '\r' characters when reading text files on Unix.
This patch ensures that we strip "\r" characters on both Windows as well
as Unix when we read text files. This should prevent the issue where
some Tor state files have been moved from a Windows machine, and thus
contains CRLF line ending, to a Unix machine where only \n is needed.

We add a test-case to ensure that we handle this properly on all our
platforms.

See: https://bugs.torproject.org/tpo/core/tor/33781
2020-07-14 17:41:51 +00:00
Alexander Færøy
aba0ff4cb5 Merge remote-tracking branch 'tor-gitlab/merge-requests/48' 2020-07-14 16:07:36 +00:00
David Goulet
c53c0e82b4 Merge branch 'tor-gitlab/mr/49' 2020-07-14 11:35:05 -04:00
Nick Mathewson
2b33e8037e Merge branch 'ticket40033_045_01_squashed' 2020-07-14 10:59:30 -04:00
David Goulet
268d01ada5 Rename blacklist and whitelist wording
Closes #40033

Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-14 10:59:18 -04:00
David Goulet
06ccf12258 node: Standardize interface of format_node_description()
Pass the IPv4 before the IPv6 like all our other interfaces.

Changes unreleased code related to #40043.

Closes #40045

Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-14 10:49:43 -04:00
Alexander Færøy
1d554e4baf Merge branch 'maint-0.4.4' 2020-07-14 14:48:21 +00:00
Alexander Færøy
07f3345e11 Merge remote-tracking branch 'tor-gitlab/merge-requests/43' into maint-0.4.4 2020-07-14 14:47:48 +00:00
David Goulet
e594195aa2 Merge branch 'tor-gitlab/mr/47' 2020-07-14 10:36:30 -04:00
David Goulet
15860c8846 addr: Use tor_addr_t instead of uint32_t for IPv4
This changes a LOT of code but in the end, behavior is the same.
Unfortunately, many functions had to be changed to accomodate but in majority
of cases, to become simpler.

Functions are also removed specifically those that were there to convert an
IPv4 as a host format to a tor_addr_t. Those are not needed anymore.

The IPv4 address field has been standardized to "ipv4_addr", the ORPort to
"ipv4_orport" (currently IPv6 uses ipv6_orport) and DirPort to "ipv4_dirport".

This is related to Sponsor 55 work that adds IPv6 support for relays and this
work is needed in order to have a common interface between IPv4 and IPv6.

Closes #40043.

Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-14 10:36:08 -04:00
David Goulet
770e047c83 doc: Fix aesthetic issues in HACKING/Tracing.md
Remove all the escape character "\" which is not needed for Markdown files.
This also fixes the tracing event include to the correct path.

Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-14 10:09:01 -04:00
David Goulet
852cf9b2e2 conn: Fix doxygen comment in connstats.c
Issue found by our CI:
https://travis-ci.org/github/torproject/tor/jobs/707731598#L6059

Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-14 09:09:14 -04:00
David Goulet
456be93956 doc: Move manpages into doc/man/
Closes #40044

Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-14 09:02:03 -04:00
David Goulet
29a474294c Merge branch 'maint-0.4.4' 2020-07-13 15:04:13 -04:00
David Goulet
515d4f1e93 Merge branch 'maint-0.4.3' into maint-0.4.4 2020-07-13 15:03:34 -04:00
Nick Mathewson
02cff32d79 Improve docs for addr, address, and real_addr fields
These fields have a complicated history, some slightly complicated
behavior, and some definitely inadequate documentation.  Before we
go fixing them up, let's document how they work now.
2020-07-13 12:13:41 -04:00
Nick Mathewson
ecb43ce21c Merge branch 'maint-0.4.4' 2020-07-13 10:45:04 -04:00
Nick Mathewson
eb427f309c Changes file for ticket 31812. 2020-07-13 10:44:39 -04:00
JeremyRand
0be80fb650 Bug 31812: Change http URL's to https 2020-07-13 10:42:46 -04:00
Nick Mathewson
0c91c63593 Merge branch 'ticket33919' 2020-07-13 10:10:57 -04:00
Nick Mathewson
59133051f9 Update channel_matches_target_addr_for_extend test to current API 2020-07-13 10:10:25 -04:00
MrSquanchee
c84ce716dc Added tests
Added tests for channel_matches_target_addr_for_extend().
Ticket #33919.
2020-07-13 09:46:11 -04:00
Nick Mathewson
0acc3ae879 Remove check-cocci from check-local target.
check-cocci is still a good idea -- perhaps as a cron job?  But
doing it as part of our regular tests has just been confusing,
especially to volunteers who shouldn't have to become coccinelle
experts in order to get their patches through our CI.

Closes #40030.
2020-07-13 09:24:26 -04:00
Guinness
b119c55776 Syntax highlighting in the docs
This adds the syntax highlights in the MarkDown files.
Fixes #33741
2020-07-13 11:45:14 +02:00
Nick Mathewson
8ebbf62940 Add an extra comment about keeping rust and c protover in sync. 2020-07-10 13:32:25 -04:00
Nick Mathewson
6a647be54a Merge remote-tracking branch 'tor-gitlab/mr/42' 2020-07-10 13:20:14 -04:00
Nick Mathewson
0c2bb9eac5 Merge remote-tracking branch 'tor-gitlab/mr/41' 2020-07-10 13:19:28 -04:00
Nick Mathewson
40eb6b19a3 NSS: Tell NSS that our SSL sockets are nonblocking.
Closes ticket 40035.
2020-07-10 13:14:33 -04:00
David Goulet
063cdb3142 Merge branch 'tor-gitlab/mr/39' 2020-07-10 13:12:22 -04:00
David Goulet
401b3a8a3c addr: Remove BUG() that always triggers
Fix on unreleased code.

Logical || in the BUG() made it that it would always trigger the BUG().

Fixes #40034

Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-10 13:09:46 -04:00
David Goulet
46b86b22e3 addr: Remove a BUG() that can normally occur
Fix on unreleased code.

The relay_new_address_suggestion() is called when a NETINFO cell is received
thus not only for relay or bridges.

Remove the BUG() that made sure only in server mode we could handle the
suggested address.

Fixes #40032

Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-10 13:06:20 -04:00
Nick Mathewson
6fb1637255 Merge remote-tracking branch 'tor-gitlab/mr/29' 2020-07-10 12:53:46 -04:00
David Goulet
dfaa0a82ac changes: Add changes file for #32910
Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-10 12:12:26 -04:00
Nick Mathewson
fae19df985 Changes file for ipv6 bidi (ticket 33264) 2020-07-10 09:52:35 -04:00
Nick Mathewson
0f60a1d33c connstats: use correct formatter for uint32_t.
We have had no reports of negative counts here, so it is probably
safe not to backport this.
2020-07-10 09:50:04 -04:00
Nick Mathewson
dbdf8bebde Collect IPv6 bidi connection statistics 2020-07-10 09:47:55 -04:00
Nick Mathewson
54141d66e2 connstats: extract functions for summarizing a connection's status 2020-07-10 09:36:07 -04:00
Nick Mathewson
0b5e19d223 connstats: extract connection type counts into a structure. 2020-07-10 09:32:30 -04:00
Nick Mathewson
515cc49cb7 connstats: add and clarify some documentation. 2020-07-10 09:27:42 -04:00
Nick Mathewson
3f2de0bcca Change connstats.c identifers to start with conn_stats
This is an automated commit, generated by this command:

./scripts/maint/rename_c_identifier.py \
        rep_hist_conn_stats_init conn_stats_init \
        rep_hist_note_or_conn_bytes conn_stats_note_or_conn_bytes \
        rep_hist_reset_conn_stats conn_stats_reset \
        rep_hist_format_conn_stats conn_stats_format \
        rep_hist_conn_stats_write conn_stats_save \
        rep_hist_conn_stats_term conn_stats_terminate \
        bidi_map_free_all conn_stats_free_all
2020-07-10 09:27:42 -04:00
Nick Mathewson
50bf2520b3 Split bidi connection-stats code into a new C file. 2020-07-10 09:27:42 -04:00
Nick Mathewson
1a4e475d5d Changes file for ticket 33263 2020-07-10 09:25:28 -04:00
Nick Mathewson
27c5cadf7e Record IPv6 bandwidth history as appropriate. 2020-07-10 09:25:28 -04:00
Nick Mathewson
a81827d99f Make channel_get_addr_if_possible() take a const channel_t.
(There is no reason that looking up the address of a channel should
ever change it.)
2020-07-10 09:25:28 -04:00
Nick Mathewson
c5db7667d6 Add IPv6 read and write history to bwhist, state, and extrainfo.
These values are stored, persisted, and published.  They are not yet
actually filled with anything.
2020-07-10 09:25:28 -04:00
Nick Mathewson
11da5229d1 Refactor bwhist_get_bandwidth_lines()
We've done a lot to improve our internal APIs since we wrote this
code, and it shows. We can just use a buf_t to build up the
bandwidth lines, and save a bunch of stack fiddling.

Additionally, we can use a function to format a single line, and
thereby get rid of the cheezy pattern that does

    for (i=0;i<n;++i) {
        switch (i) {
           ...
        }
        ...
    }
2020-07-10 09:25:28 -04:00
Nick Mathewson
c5eb601e60 Rename private bandwidth-history identifiers to start with "bwhist".
This commit is a simple search-and-replace in bwhist.c
2020-07-10 07:56:21 -04:00
Nick Mathewson
2fc8257ac4 Rename public bandwidth-history identifiers to start with "bwhist".
This is an automated commit, generated by this command:

./scripts/maint/rename_c_identifier.py \
        rep_hist_note_bytes_read bwhist_note_bytes_read \
        rep_hist_note_bytes_written bwhist_note_bytes_written \
        rep_hist_note_dir_bytes_read bwhist_note_dir_bytes_read \
        rep_hist_note_dir_bytes_written bwhist_note_dir_bytes_written \
        rep_hist_get_bandwidth_lines bwhist_get_bandwidth_lines \
        rep_hist_update_state bwhist_update_state \
        rep_hist_load_state bwhist_load_state \
        rep_hist_bandwidth_assess bwhist_bandwidth_assess
2020-07-10 07:54:04 -04:00
Nick Mathewson
8390df917b Split bandwidth history functions into a separate C file.
These are logically independent from the rest of rephist, and make
more sense in isolation.  The next patch will rename them too.
2020-07-10 07:50:17 -04:00