Commit Graph

26399 Commits

Author SHA1 Message Date
Nick Mathewson
3e3b0b0443 Merge remote-tracking branch 'tor-github/pr/1986/head' 2020-08-03 08:33:22 -04:00
Nick Mathewson
efe8a98817 Fix a leak-on-failure on test_get_bandwidth_lines()
Spotted by coverity. This is CID 1465571.
2020-08-01 09:29:08 -04:00
Neel Chauhan
837e0c4dc9 Code simplifications for AP_CONN_STATE_CONTROLLER_WAIT 2020-07-31 09:21:43 -07:00
MrSquanchee
bb585c5e37
test_stats : Removed CONFIG_PRIVATE
Signed-off-by: Suraj Upadhyay <usuraj35@gmail.com>
2020-07-31 21:12:29 +05:30
MrSquanchee
a93c3d7a8d
Added tests for bandwidth functions
Added tests for
1. commit_max
2. advance_obs
3. add_obs
4. rep_hist_fill_bandwidth_history
5. rep_hist_get_bandwidth_lines

 (Lightly edited by nickm to use new names from bwhist refactoring.)

Signed-off-by: Suraj Upadhyay <usuraj35@gmail.com>
2020-07-31 21:12:16 +05:30
MrSquanchee
708f51637f
Added tests for bandwidth functions
Added tests for
1. commit_max
2. advance_obs
3. add_obs
4. rep_hist_fill_bandwidth_history
5. rep_hist_get_bandwidth_lines

Signed-off-by: Suraj Upadhyay <usuraj35@gmail.com>
2020-07-31 21:10:54 +05:30
Nick Mathewson
b5068e4826 Extract bw_array_t and related constants into a header.
This will be used for testing.

Partially reproduces work by MrSquanchee in #33812.
2020-07-31 10:46:52 -04:00
Nick Mathewson
4c810a6abe Merge branch 'bug40076_044' 2020-07-30 14:35:06 -04:00
Nick Mathewson
b4400e2093 Merge branch 'bug40076_043' into bug40076_044 2020-07-30 14:28:11 -04:00
Nick Mathewson
69d7752937 Merge branch 'bug40076_042' into bug40076_043 2020-07-30 14:27:29 -04:00
Nick Mathewson
c2d5ec5e43 Merge branch 'maint-0.4.2' into bug40076_042 2020-07-30 14:27:29 -04:00
Nick Mathewson
c4742b89b2 Fix a bug in buf_move_all() when the input buffer is empty.
We found this in #40076, after we started using buf_move_all() in
more places.  Fixes bug #40076; bugfix on 0.3.3.1-alpha.  As far as
I know, the crash only affects master, but I think this warrants a
backport, "just in case".
2020-07-30 14:24:25 -04:00
Nick Mathewson
0a588821cb Add unit test for buf_move_all(), including a failing case
The failing case is #if'd out for now, but will be fixed in the next
commit.

Testing for a fix for #40076.
2020-07-30 14:19:32 -04:00
George Kadianakis
155e0dee49 Merge branch 'tor-gitlab/mr/84' 2020-07-30 19:49:25 +03:00
Nick Mathewson
219edc9ab1 Handle ORPort auto when logging about removed orports.
Closes #40075
2020-07-30 19:46:44 +03:00
George Kadianakis
2bb9acca73 Write unittest for #40065.
Make the unit test pass by including an explicit IPv6 port and an
implicit IPv4 port.  See comments for more details.
2020-07-30 19:46:39 +03:00
Nick Mathewson
fc5fe094b1 Fix segfault and logic error in remove_duplicate_orports()
This function tried to modify an array in place, but did it in a
pretty confusing and complicated way.  I've revised it to follow a
much more straightforward approach.

Fixes bug #40065.
2020-07-30 19:46:02 +03:00
Nick Mathewson
9164d7c75e Merge branch 'maint-0.4.4' 2020-07-29 12:37:08 -04:00
Nick Mathewson
3b8bf743ae Merge branch 'maint-0.4.2' into maint-0.4.3 2020-07-29 12:37:07 -04:00
Nick Mathewson
cdb0e6c252 Merge branch 'maint-0.3.5' into maint-0.4.2 2020-07-29 12:37:07 -04:00
Nick Mathewson
8c92d44622 Merge remote-tracking branch 'tor-gitlab/mr/68' into maint-0.4.4 2020-07-29 12:35:57 -04:00
Nick Mathewson
75f94ea1ec Merge remote-tracking branch 'tor-github/pr/1987/head' 2020-07-29 10:58:47 -04:00
Alexander Færøy
eba2870d18 Merge branch 'maint-0.4.4' 2020-07-29 13:58:14 +00:00
Alexander Færøy
8e690ce736 Merge remote-tracking branch 'tor-gitlab/mr/85' into maint-0.4.4 2020-07-29 13:57:47 +00:00
Alexander Færøy
109063185b Merge branch 'tor-gitlab/mr/73_squashed' 2020-07-29 13:34:24 +00:00
Nick Mathewson
3cb9a9b8ce Remove the connection_t.outbuf_flushlen field
This was once used for rate-limiting, but now it's only for
accounting.  It hasn't served a useful purpose in a long time.

Closes ticket 33097.
2020-07-29 13:33:35 +00:00
Daniel Pinto
eab8e7af52 Fix startup crash with seccomp sandbox enabled #40072
Fix crash introduced in #40020. On startup, tor calls
check_private_dir on the data and key directories. This function
uses open instead of opendir on the received directory. Data and
key directoryes are only opened here, so the seccomp rule added
should be for open instead of opendir, despite the fact that they
are directories.
2020-07-29 00:34:08 +01:00
Nick Mathewson
dcc60294ad Use _lseeki64() on windows.
Fixes bug 31036; bugfix on 0.2.1.8-alpha when we moved the logging
system to use posix fds.
2020-07-28 11:30:47 -04:00
Nick Mathewson
0a38e02fb3 bump to 0.4.4.3-alpha-dev 2020-07-27 19:15:15 -04:00
Nick Mathewson
98d84587a8 Fix documentation of cache_failure_intro_lookup
Closes ticket 17793
2020-07-27 14:22:10 -04:00
Nick Mathewson
31eba7f009 Merge branch 'maint-0.4.3' into maint-0.4.4 2020-07-27 12:56:19 -04:00
Nick Mathewson
64d7b28298 Merge branch 'maint-0.4.4' 2020-07-27 12:56:19 -04:00
Nick Mathewson
97d0cb83ed Merge branch 'maint-0.4.2' into maint-0.4.3 2020-07-27 12:56:18 -04:00
Nick Mathewson
c0bc30b6f0 Merge branch 'maint-0.3.5' into maint-0.4.2 2020-07-27 12:56:18 -04:00
Nick Mathewson
95914ceb57 Bump to 0.4.4.3-alpha 2020-07-27 08:32:56 -04:00
Nick Mathewson
010387e4bd Merge branch '40068_maybe' 2020-07-24 15:15:46 -04:00
David Goulet
564a9a54a1 fallbackdir: Remove all three Digitalcourage3 relays
They are about to be shutdown in September.

Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-24 14:56:07 -04:00
Nick Mathewson
2299b31f40 Don't let a bad IPv6 orport stop our IPv4 bandwidth test.
Specifically: do not close IPv4 bandwidth-testing circuits just
because our IPv6 orport is unreachable.

Attempted fix for #40068.
2020-07-24 14:50:42 -04:00
David Goulet
ad9806b539 relay: Publish IPv4 descriptor on guessed IPv6 reachability failure
On an IPv6 reachability failure test, if the address was configured, don't
publish the descriptor and log warn. If the address was auto discovered, still
publish the descriptor.

Closes #33247.

Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-24 12:18:07 -04:00
David Goulet
fda0fa02bf relay: Add a cache that tracks which address was configured
Related to #33247

Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-24 11:32:49 -04:00
David Goulet
bf2b1e7a6f relay: Turn find address "method_used" into enum
Enum allows us to easily compare what is being returned but also better
semantic to the code.

Related #33247

Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-24 11:32:49 -04:00
Nick Mathewson
9d922b8eaa Merge branch 'maint-0.4.4' 2020-07-23 10:10:32 -04:00
Nick Mathewson
6354b70e49 Merge branch 'maint-0.4.2' into maint-0.4.3 2020-07-23 10:09:14 -04:00
Nick Mathewson
3bcbd69a77 Merge branch 'maint-0.3.5' into maint-0.4.2 2020-07-23 10:09:14 -04:00
Nick Mathewson
07934664c5 Merge branch 'maint-0.4.3' into maint-0.4.4 2020-07-23 10:09:14 -04:00
David Goulet
6f19e67c98 fallbackdir: Update list for 2020
Closes #40061

Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-23 10:05:11 -04:00
Nick Mathewson
b3112a6d26 Merge branch 'remove-padding-fix-7869-v2' 2020-07-23 08:26:44 -04:00
Daniel Pinto
d72618eb7f Remove padding from ntor-onion-key #7869 2020-07-23 08:25:22 -04:00
David Goulet
9cd20e8276 Merge branch 'tor-gitlab/mr/75' 2020-07-23 07:16:05 -04:00
David Goulet
884ccd6996 Merge branch 'maint-0.4.4' 2020-07-22 16:14:19 -04:00