Commit Graph

11205 Commits

Author SHA1 Message Date
Nick Mathewson
af60e7566e Update test_status.c to accommodate changes in heartbeat messages
Fixes #15012; bug not in any released Tor
2015-02-24 10:05:34 -05:00
Nick Mathewson
d74a78c58a Merge branch 'bug14950_logs_squashed' 2015-02-23 13:04:03 -05:00
Nick Mathewson
d221b507c9 Avoid logging natural-language reports that are redundant with bootstrapping 2015-02-23 13:03:56 -05:00
Nick Mathewson
10ae9b9bf5 Usually downgrade middle heartbeat messages when stuff is in-range 2015-02-23 13:03:56 -05:00
Nick Mathewson
f1fa85ea73 Fix running with the seccomp2 sandbox
We had a regression in 0.2.6.3-alpha when we stopped saying
IPPROTO_TCP to socket().  Fixes bug 14989, bugfix on 0.2.6.3-alpha.
2015-02-23 12:16:08 -05:00
cypherpunks
5246e8f992 Remove lingering mempool code 2015-02-23 11:19:31 -05:00
Nick Mathewson
8a9d86bf05 Merge remote-tracking branch 'public/bug11454_11457' 2015-02-20 01:08:12 -05:00
Nick Mathewson
03a4e97c76 Merge remote-tracking branch 'origin/maint-0.2.5' 2015-02-20 01:05:21 -05:00
Nick Mathewson
1525eeeb49 Merge remote-tracking branch 'origin/maint-0.2.4' into maint-0.2.5 2015-02-20 01:04:49 -05:00
Nick Mathewson
76d8c23ab4 Try to fix authdir_newdesc events
We were sending values that were truncated by the length of the
annotations.
2015-02-19 11:35:27 -05:00
Nick Mathewson
b897e386da Merge branch 'bug12844_macros' 2015-02-19 09:41:36 -05:00
Nick Mathewson
557a0c83f3 Do not try to download an EI for which we don't have a matching SD.
This quiets some log messages for #13762, and adds a better INFO message
for the underlying confusion.
2015-02-19 09:40:36 -05:00
Nick Mathewson
86105a4009 Check ENABLE_TOR2WEB_MODE before any tor2webmode code 2015-02-19 09:09:25 -05:00
Roger Dingledine
64d5e0e417 stop warning each time we check minimum-dir-info
We already log whenever our state changes, e.g. whenever new directory
information arrives. This additional log_warn() will at best just add more
log messages, or worse, make the user wonder what she needs to fix.

(Changed after consultation with Yawning.)
2015-02-19 06:27:14 -05:00
Roger Dingledine
70f46f7ae6 don't update dir_info_status when we have minimum dir info
Nothing ever uses the string when we're in "have minimum dir info"
state. The flow of the function is "check for problems, if you see a
problem write an explanation to dir_info_status and set res to 0". If
you get to the end of the function without any problems, then res =
1 and we're all ready to start making circuits.

(Changed after consultation with Yawning.)
2015-02-19 06:15:25 -05:00
Roger Dingledine
0e4bdc4005 clean up comments and whitespace a bit 2015-02-18 19:27:02 -05:00
Nick Mathewson
b7b8b9ecf9 Downgrade new extrainfo_insert warnings on startup 2015-02-18 13:41:00 -05:00
Nick Mathewson
a767b66640 Merge branch 'bug13762_diagnostic_redux' 2015-02-18 13:29:12 -05:00
Nick Mathewson
d3f714deb8 Patch from cypherpunks to try to diagnose 8387. 2015-02-18 13:25:01 -05:00
Nick Mathewson
e65fe0a747 Improve log messages for diagnosing 13762 2015-02-18 13:05:15 -05:00
Yawning Angel
39a496eeb8 Actually free measured_guardfraction.
CID 1270894
2015-02-18 16:36:57 +00:00
Nick Mathewson
6378bcf4b9 Fix an implicit-narrowing warning 2015-02-18 09:34:15 -05:00
Nick Mathewson
9e6147a40c Merge remote-tracking branch 'yawning/bug14918' 2015-02-18 09:21:16 -05:00
Nick Mathewson
96211bcf71 Merge branch 'bug9321_rerebase'
Conflicts:
	src/or/dirvote.h
	src/test/include.am
	src/test/test_entrynodes.c
2015-02-18 09:17:02 -05:00
George Kadianakis
5c34a53068 Don't exit if we can't find the GuardfractionFile when booting.
...just disable the feature in that case.
2015-02-18 09:09:34 -05:00
George Kadianakis
33053d50a0 Final guardfraction preparations for upstream merge.
- Write a changes file.
- Change some logs to lesser severities.
2015-02-18 09:09:34 -05:00
George Kadianakis
b941f109ac Calculate relay weighted bandwidth using guardfraction bandwidths.
Now use the guardfraction function to calculate individual relay
bandwidth weights.
2015-02-18 09:09:34 -05:00
George Kadianakis
f7a8b19184 Calculate total bandwidth weights using the guardfraction bandwidths.
Now use the function introduced in the previous commit, to calculate the
total bandwidth weights when making the consensus.
2015-02-18 09:09:33 -05:00
George Kadianakis
14a3c17ce6 Calculate the guardfraction bandwidth of a guard. 2015-02-18 09:09:33 -05:00
George Kadianakis
f4a63f8eab Parse GuardFraction info from consensuses and votes.
Also introduce the UseGuardFraction torrc option which decides whether
clients should use guardfraction information found in the consensus.
2015-02-18 09:09:33 -05:00
George Kadianakis
db805b9170 Write GuardFraction information to consensus.
If we've seen enough votes with guardfraction information, write down
the GuardFraction string in the consensus.
2015-02-18 09:09:33 -05:00
George Kadianakis
7ddfb6aa2f Write guardfraction information to votes.
If a dirauth has guardfraction information about a guard, write it down
when serializing the routerstatus.
2015-02-18 09:09:33 -05:00
George Kadianakis
5ee48d47a7 Parse Guardfraction file and apply results to routerstatuses.
Parse the file just before voting and apply its information to the
provided vote_routerstatus_t. This follows the same logic as when
dirauths parse bwauth files.
2015-02-18 09:09:32 -05:00
Yawning Angel
8571e86d27 Fix bootstrap directory information logging.
`dir_info_status` is used from main.c:directory_info_has_arrived() to
provide useful (INFO/NOTICE) level logging to users, and should always
be updated regardless of the rate limiting.
2015-02-18 13:58:13 +00:00
Yawning Angel
6fdb179d84 Fix compute_frac_paths_available, when ExitNodes is not set. 2015-02-18 12:51:07 +00:00
Yawning Angel
cbd26157c5 Remove tor_strclear(), and replace previous calls with memwipe(). 2015-02-17 18:53:33 +00:00
Nick Mathewson
d038430a14 Merge branch 'bug14918' 2015-02-17 12:49:29 -05:00
Nick Mathewson
9bf6da1861 Merge remote-tracking branch 'public/feature_13822' 2015-02-17 12:34:13 -05:00
Nick Mathewson
8eb3d81e6e Fix some issues with reporting exit-free networks
Fixes bug 14918.
2015-02-17 12:07:24 -05:00
Roger Dingledine
d6dbd55849 trivial whitespace fix 2015-02-17 06:01:33 -05:00
Nick Mathewson
0b3ae7d9e5 Maybe this will make coverity not care that this check is dead. CID 1268063 2015-02-16 15:44:18 -05:00
Nick Mathewson
2fe139473d No, coverity, this is not a memory leak. 1268065 2015-02-16 15:42:48 -05:00
Nick Mathewson
5d2a23397a Fix a few coverity "Use after NULL check" warnings
Also remove the unit test mocks that allowed get_options() to be
NULL; that's an invariant violation for get_options().
2015-02-16 15:40:15 -05:00
Sina Rabbani
8e61d38cf1 Faravahar's New IP Address as of 2/20/2015 2015-02-16 11:51:36 -05:00
Sebastian Hahn
3bcdb26267 Call cpu_init if we change to being a relay
The issue is that we use the cpuworker system with relays only, so if we
start up as a client and transition to being a relay later, we'll be
sad.

This fixes bug 14901; not in any released version of Tor.
2015-02-15 11:49:19 +01:00
Nick Mathewson
b223b7c22d fix a compilation warning 2015-02-11 15:10:35 -05:00
Nick Mathewson
d7a1e83f50 Merge remote-tracking branch 'public/remove_freelist' 2015-02-11 15:09:01 -05:00
Nick Mathewson
caf28519d9 Merge branch 'bug12844'
Conflicts:
	src/or/circuituse.c
	src/test/include.am
	src/test/test_entrynodes.c
2015-02-11 15:06:04 -05:00
Nick Mathewson
0899f51bc6 Additional paranoia: do not even build tor2web stuff if not using.
(That is, don't build it unless we're building for tor2web, or we
are building for tests.)
2015-02-11 14:54:16 -05:00
Nick Mathewson
6f331645c7 Remove mempools and buf freelists
They have been off-by-default since 0.2.5 and nobody has complained. :)

Also remove the buf_shrink() function, which hasn't done anything
since we first stopped using contiguous memory to store buffers.

Closes ticket 14848.
2015-02-11 09:03:50 -05:00
Nick Mathewson
0c81dfa848 Merge remote-tracking branch 'public/feature_13555' 2015-02-11 08:42:00 -05:00
Sebastian Hahn
9667b2b88a Add some comments to or_circuit_t.workqueue_entry
These were suggested by dgoulet, thanks!
2015-02-09 16:13:08 +01:00
Sebastian Hahn
7337510090 Avoid use-after-free of circ belonging to cancelled job
This fixes a bug where we decide to free the circuit because it isn't on
any workqueue anymore, and then the job finishes and the circuit gets
freed again.

Fixes bug #14815, not in any released version of Tor.
2015-02-09 16:12:47 +01:00
Sebastian Hahn
37d16c3cc7 Reserve enough space for rend_service_port_config_t
In #14803, Damian noticed that his Tor sometimes segfaults. Roger noted
that his valgrind gave an invalid write of size one here. Whenever we
use FLEXIBLE_ARRAY_MEMBER, we have to make sure to actually malloc a
thing that's large enough.

Fixes bug #14803, not in any released version of Tor.
2015-02-09 04:48:16 +01:00
Nick Mathewson
8b82f6261e Search-and-replace to regain coding style in wake of 13822.
(all-caps should be reserved for global or module-global constants and
2015-02-07 08:33:36 -05:00
Nick Mathewson
4beb830953 Split ROUTER_REQUIRED_MIN_BANDWIDTH into RELAY_ and BRIDGE_ variants
Also raise those minima from 20 to 75 and 50 respectively.

Closes ticket 13822.
2015-02-07 08:33:23 -05:00
David Goulet
b101f4e98c Control: getinfo entry-guards report down-since
If the guard unreachable_since variable was set, the status "up" was
reported which is wrong. This adds the "down" status followed by the
unreachable_since time value.

Fixes #14184

Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-02-06 16:06:20 -05:00
Nick Mathewson
e36faeec1d Merge remote-tracking branch 'sebastian/bug13993' 2015-02-06 15:42:53 -05:00
Sebastian Hahn
e0c3de40ad Fix check-spaces complaints 2015-02-06 21:36:40 +01:00
Sebastian Hahn
b3bc871214 Add unit test for #13290 2015-02-06 21:04:05 +01:00
Yawning Angel
16cf1679e7 Fix scheduler compilation on targets where char is unsigned.
Per discussion with nickm, the `dir` argument should be a int rather
than a signed char.

Fixes bug #14764.
2015-02-06 16:26:28 +00:00
Nick Mathewson
1799c2be09 Merge remote-tracking branch 'public/bug13796' 2015-02-05 22:53:15 -05:00
Nick Mathewson
2274221557 Fix a work-counting bug introduced by the workqueue merge
David Goulet finds that when he runs a busy relay for a while with the
latest version of the git code, the number of onionskins handled
slowly dwindles to zero, with total_pending_tasks wedged at its
maximum value.

I conjecture this is because the total_pending_tasks variable isn't
decremented when we successfully cancel a job.  Fixed that.

Fixes bug 14741; bugfix not on any released version of tor.
2015-02-05 12:17:08 -05:00
Nick Mathewson
daab405168 Bump the minimum relay version to 0.2.4.18-rc
Closes #13555
2015-02-04 13:27:56 -05:00
Nick Mathewson
a8835170d7 Use getsockname, not getsockopt, on TPROXY sockets 2015-02-04 10:09:54 -05:00
Nick Mathewson
5be48c5d4c Work around test_status.c weirdness
Ordinarily, get_options() can never return NULL, but with
test_status.c mocking, it can.  So test for that case.

The best fix here would be to pass the options value to a
bridge_server_mode() function.
2015-02-03 15:50:31 -05:00
Nick Mathewson
cdc49629c7 Merge branch 'bug6852'
Conflicts:
	src/or/status.c
2015-02-03 13:06:58 -05:00
Nick Mathewson
7f52dc4d03 Choose a more deliberate cutoff for clients in heartbeat 2015-02-03 13:02:22 -05:00
Nick Mathewson
d03e1da232 Merge remote-tracking branch 'public/bug9635_warnings_025'
Conflicts:
	src/test/test.c
2015-02-02 16:31:32 -05:00
Nick Mathewson
41ba4f5627 tweak based on comments from dgoulet 2015-02-02 14:42:33 -05:00
Nick Mathewson
03563f4723 Fix an unused-variable warning. 2015-02-02 13:35:44 -05:00
Nick Mathewson
79c7625e38 Merge branch 'feature13864_squashed' 2015-02-02 13:32:53 -05:00
rl1987
fe328d192e Allow reading torrc from stdin. 2015-02-02 13:31:56 -05:00
Nick Mathewson
f4b79bc420 Merge remote-tracking branch 'sysrqb/bug14216_bad_since' 2015-02-02 10:23:52 -05:00
Nick Mathewson
55639bc67f Merge remote-tracking branch 'dgoulet/bug14202_026_v1' 2015-02-02 10:16:48 -05:00
Matthew Finkel
4cb59ceb8e Only retry connecting to configured bridges
After connectivity problems, only try connecting to bridges which
are currently configured; don't mark bridges which we previously
used but are no longer configured.  Fixes 14216.  Reported by
and fix provided by arma.
2015-01-31 09:46:18 +00:00
Nick Mathewson
097286e476 Fix some unused-argument warnings 2015-01-30 14:47:56 -05:00
Nick Mathewson
bc9ade055e Fix an uninitialized-variable warning. 2015-01-30 14:46:18 -05:00
David Goulet
44e9dafb67 Fix: test -ENOENT after config_parse_unix_port()
Check for -ENOENT instead of ENOENT after the HS port is parsed.

Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-01-30 14:13:27 -05:00
Nick Mathewson
fac8d40886 Merge remote-tracking branch 'public/prop227_v2'
Conflicts:
	src/test/test_dir.c
2015-01-30 07:36:55 -05:00
Nick Mathewson
d1e52d9a2a Correctly handle OutboundBindAddress again.
ca5ba2956b broke this; bug not in any
released Tor.

Also fix a typo.

Fixes 14541 and 14527.  Reported by qbi.
2015-01-30 07:29:23 -05:00
Nick Mathewson
4c1a779539 Restrict unix: addresses to control and socks for now 2015-01-29 14:51:59 -05:00
Nick Mathewson
204374f7d9 Remove SocksSocket; it's now spelled differently thanks to 14451
Also, revise bug12585 changes file to mention new syntax
2015-01-29 14:46:20 -05:00
Nick Mathewson
b4a8fd8958 When there are no package lines, make consensus/packages say "".
Also, give a better error message when there is no consensus.
2015-01-29 14:14:59 -05:00
Nick Mathewson
bd630a899a Correctly reject packages lines with empty entries 2015-01-29 14:09:57 -05:00
Nick Mathewson
f935ee2dae Define 'digesttype' correctly 2015-01-29 14:04:21 -05:00
David Goulet
80bed1ac96 Remove obsolete workaround in dirserv_thinks_router_is_hs_dir()
Fixes #14202

Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-01-29 12:55:19 -05:00
David Goulet
ebc59092bc Make hidden service use the config unix prefix
Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-01-28 18:01:53 -05:00
David Goulet
bf3fb55c47 Support unix: prefix in port configuration
It's now possible to use SocksPort or any other kind of port that can use a
Unix socket like so:

  SocksPort unix:/foo/bar/unix.sock

Fixes #14451

Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-01-28 17:55:38 -05:00
Nick Mathewson
a3de2dfde6 Merge branch 'bug11485_026_v2_squashed' 2015-01-28 14:32:19 -05:00
David Goulet
fb523b543a fixup! Refactor the use of ifdef HAVE_SYS_UN_H
Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-01-28 14:30:23 -05:00
Andrea Shepard
bce824a9ad Actually make connections to HSes on AF_UNIX sockets 2015-01-28 14:30:23 -05:00
Andrea Shepard
ca5ba2956b Support connection_exit_connect() to AF_UNIX sockets 2015-01-28 14:30:23 -05:00
Andrea Shepard
6564291601 Handle config options for AF_UNIX hidden services rendservice.c 2015-01-28 14:30:23 -05:00
Arthur Edelstein
cb714d896c Bug #8405: Report SOCKS username/password in CIRC status events
Introduces two new circuit status name-value parameters: SOCKS_USERNAME
and SOCKS_PASSWORD. Values are enclosing in quotes and unusual characters
are escaped.

Example:

    650 CIRC 5 EXTENDED [...] SOCKS_USERNAME="my_username" SOCKS_PASSWORD="my_password"
2015-01-28 12:02:15 -05:00
Nick Mathewson
32dad3b83b Add GETINFO consensus/{valid-{after,until},fresh-until} 2015-01-28 11:28:21 -05:00
Nick Mathewson
c240eea0df more typo fixes from mcs and gk 2015-01-28 11:25:37 -05:00
Nick Mathewson
20d0b1a04e Bump a client authorization message from debug to info.
A user wants this for 14015, and it seems fairly reasonable.
2015-01-28 09:42:28 -05:00
Nick Mathewson
9c4328c038 New GETINFO consensus/packages to expose package information from consensus 2015-01-27 16:40:32 -05:00
Nick Mathewson
1e61b45251 Fixes on prop227 comments, based on comments by mcs on #10395 2015-01-27 16:31:48 -05:00