Commit Graph

16845 Commits

Author SHA1 Message Date
Nick Mathewson
a6c7630845 Unit tests for a few more functions and cases in address.c
This brings address's coverage up over 80%.
2013-03-01 14:48:33 -05:00
Nick Mathewson
6dfa709030 Remove the unused addr_mask_cmp_bits 2013-03-01 14:46:34 -05:00
Nick Mathewson
24fb926726 Remove the unused parse_addr_and_port_range 2013-03-01 14:35:17 -05:00
Nick Mathewson
f6697d5b3b More unit tests for old TAP onion handshake.
The test coverage for onion_tap.c is now at 89%, up from 67%.
2013-03-01 14:06:09 -05:00
Nick Mathewson
165b2c0123 Add unit test for tor_addr_is_loopback 2013-03-01 12:40:41 -05:00
Nick Mathewson
b528aaef03 Make sure that [::1] is recognized as a private address
Fixes bug 8377; bugfix on 0.2.1.3-alpha.
2013-03-01 12:22:57 -05:00
Nick Mathewson
045c989d03 Merge remote-tracking branch 'origin/maint-0.2.4' 2013-03-01 10:19:19 -05:00
Andrea Shepard
74c33945e3 Correctly set entry->is_dir_cache when adding an entry guard for the first time
(Second part of a bug8367 fix. -NM)
2013-03-01 10:17:07 -05:00
Nick Mathewson
ad49abe5a1 Fix bootstrapping with bridges by making is_dir_cache is set on them.
This fixes bug 8367, introduced in d7089ff228. Not in
any released Tor.
2013-03-01 10:17:07 -05:00
Nick Mathewson
dc4ccfdbe2 Merge branch 'bug8367_v2' 2013-03-01 09:33:15 -05:00
Andrea Shepard
8b26766a66 Correctly set entry->is_dir_cache when adding an entry guard for the first time
(Second part of a bug8367 fix. -NM)
2013-03-01 09:32:37 -05:00
Nick Mathewson
c0b1f05fe7 Fix bootstrapping with bridges by making is_dir_cache is set on them.
This fixes bug 8367, introduced in d7089ff228. Not in
any released Tor.
2013-03-01 09:32:17 -05:00
Nick Mathewson
c72d58cbff Merge remote-tracking branch 'public/feature8109' 2013-03-01 00:33:37 -05:00
Nick Mathewson
94d0f226e6 Whoops. I forgot the "alpha" 2013-03-01 00:16:46 -05:00
Nick Mathewson
d9293ab3a7 Bump version in master to 0.2.5.0-alpha-dev 2013-03-01 00:13:36 -05:00
Andrea Shepard
b5a164bde4 Prefer measured bandwidths over advertised when computing things for votes on a dirauth 2013-02-27 19:43:50 -08:00
Nick Mathewson
4740d2e8bc Remove some lingering tsocks cruft.
Now the manpages no longer refer to tsocks or tsocks.conf, and we no
longer have or ship a tor-tsocks.conf.  The only remaining instances
of "tsocks" in our repository are old ChangeLog and ReleaseNotes
entries, and the torify script saying that it doesn't support tsocks.

Fixes bug 8290.
2013-02-27 19:39:57 -05:00
Roger Dingledine
9bc05c30d7 update the in-progress bandwidth requirements for authorities 2013-02-25 09:19:04 -05:00
Nick Mathewson
6879910334 Fix a comment in tor_main.c
We don't use subversion or src/*/makefile.am any longer
2013-02-25 03:24:53 -05:00
Nick Mathewson
a4e9d67292 Remove some functions which were unused except for their tests 2013-02-23 23:38:43 -05:00
Nick Mathewson
5bfa373eee Remove some totally unused functions 2013-02-23 23:31:31 -05:00
Nick Mathewson
365e302f61 Remove a bunch of unused macro definitions 2013-02-23 23:05:25 -05:00
Nick Mathewson
7bb51fdd89 Rename circuit_expire_all_dirty_circs
The new name is circuit_mark_all_dirty_circs_as_unusable.

This resolves an XXX024
2013-02-19 18:37:03 -05:00
Nick Mathewson
62fb209d83 Stop frobbing timestamp_dirty as our sole means to mark circuits unusable
In a number of places, we decrement timestamp_dirty by
MaxCircuitDirtiness in order to mark a stream as "unusable for any
new connections.

This pattern sucks for a few reasons:
  * It is nonobvious.
  * It is error-prone: decrementing 0 can be a bad choice indeed.
  * It really wants to have a function.

It can also introduce bugs if the system time jumps backwards, or if
MaxCircuitDirtiness is increased.

So in this patch, I add an unusable_for_new_conns flag to
origin_circuit_t, make it get checked everywhere it should (I looked
for things that tested timestamp_dirty), and add a new function to
frob it.

For now, the new function does still frob timestamp_dirty (after
checking for underflow and whatnot), in case I missed any cases that
should be checking unusable_for_new_conns.

Fixes bug 6174. We first used this pattern in 516ef41ac1,
which I think was in 0.0.2pre26 (but it could have been 0.0.2pre27).
2013-02-19 18:29:17 -05:00
Nick Mathewson
5d2b2b9ede Clear up a comment about when an assertion could fire
Resolves ticket 6164
2013-02-19 16:23:58 -05:00
Nick Mathewson
337e32f5b8 fix a wide line 2013-02-19 15:08:54 -05:00
Nick Mathewson
8ddf4e218e Merge branch 'bug8065_v2' 2013-02-19 15:02:22 -05:00
Nick Mathewson
3340d3279d Downgrade an assert to LD_BUG
This should prevent crashes on further recurrence of 8065, and help
diagnose such if they occur
2013-02-19 15:02:08 -05:00
Nick Mathewson
804be10b09 Fix a may-be-used-uninitialized warning. 2013-02-19 15:00:08 -05:00
Nick Mathewson
b0b0d6af63 Merge branch 'bug2286_unit_test_squashed' 2013-02-19 14:54:05 -05:00
Andrea Shepard
699c39dada Test alternate values of maxunmeasuredbw too 2013-02-19 14:53:31 -05:00
Andrea Shepard
f445aae2e3 Update unmeasured bandwidth clipping unit test per NickM's bugfix for the Unmeasured=1 issue 2013-02-19 11:06:24 -05:00
Nick Mathewson
6170bc5a93 Refactor storing of measured_bw versus Unmeasured=1.
This patch moves the measured_bw field and the has_measured_bw field
into vote_routerstatus_t, since only votes have 'Measured=XX' set on
their weight line.

I also added a new bw_is_unmeasured flag to routerstatus_t to
represent the Unmeasured=1 flag on a w line.  Previously, I was using
has_measured_bw for this, which was quite incorrect: has_measured_bw
means that the measured_bw field is set, and it's probably a mistake
to have it serve double duty as meaning that 'baandwidth' represents a
measured value.

While making this change,I also found a harmless but stupid bug in
dirserv_read_measured_bandwidths: It assumes that it's getting a
smartlist of routerstatus_t, when really it's getting a smartlist of
vote_routerstatus_t.  C's struct layout rules mean that we could never
actually get an error because of that, but it's still quite incorrect.
I fixed that, and in the process needed to add two more sorting and
searching helpers.

Finally, I made the Unmeasured=1 flag get parsed.  We don't use it for
anything yet, but someday we might.

This isn't complete yet -- the new 2286 unit test doesn't build.
2013-02-19 11:06:24 -05:00
Andrea Shepard
4c45b3d845 Add unit test for unmeasured bandwidth clipping in consensus 2013-02-19 11:06:24 -05:00
Andrea Shepard
f4d5ca9b5e Refactor v3_networkstatus test to allow reuse of test for measuredbw 2013-02-19 11:06:24 -05:00
Nick Mathewson
869826581d Note some annoyinc copy-and-paste code 2013-02-19 11:06:23 -05:00
Nick Mathewson
e73bbea262 Tweak consensus method 17 based on arma's comments
Instead of capping whenever a router has fewer than 3 measurements,
we cap whenever a router has fewer than 3 measurements *AND* there
are at least 3 authorities publishing measured bandwidths.

We also generate bandwidth lines with a new "Unmeasured=1" flag,
meaning that we didn't have enough observations for a node to use
measured bandwidth values in the authority's input, whether we capped
it or not.
2013-02-19 11:05:15 -05:00
Roger Dingledine
f2199763cf touchups on 78582760 2013-02-19 04:07:36 -05:00
Nick Mathewson
2b1119db77 Document (on man page) which DNS record types Tor knows.
Fixes bug 7876
2013-02-19 02:47:44 -05:00
Nick Mathewson
7858276066 Revise some comments in router.c
Avoid the phrase "legally valid" (as opposed to valid but not legal)?
And document what functions really do.

Fix for bug 6935.
2013-02-19 02:43:36 -05:00
Nick Mathewson
22804c0391 Check for CPUs more accurartely when ONLN != CONF.
There are two ways to use sysconf to ask about the number of
CPUs. When we're on a VM, we would sometimes get it wrong by asking
for the number of total CPUs (say, 64) when we should have been asking
for the number of CPUs online (say, 1 or 2).

Fix for bug 8002.
2013-02-19 02:34:36 -05:00
Nick Mathewson
59fc77e29b Fix a bug that roger found in the wide_circ_id code 2013-02-15 18:20:46 -05:00
Nick Mathewson
e6e929f5cf Merge remote-tracking branch 'public/bug8209' 2013-02-15 16:37:53 -05:00
Nick Mathewson
73182e3220 Merge remote-tracking branch 'public/bug8207' 2013-02-15 16:29:43 -05:00
Nick Mathewson
d6634001c9 Merge remote-tracking branch 'public/wide_circ_ids'
Conflicts:
	src/or/channel.h
	src/or/connection_or.c
	src/or/cpuworker.c
2013-02-15 16:23:43 -05:00
Nick Mathewson
5fcc5dfa77 make check-spaces 2013-02-15 16:02:57 -05:00
Nick Mathewson
0fa362cafa Merge remote-tracking branch 'public/feature4994-rebased' 2013-02-15 15:58:54 -05:00
Nick Mathewson
6c8b6e9e78 Fix unreachable use-before-assign in test_util_join_win_cmdline
Apparently there is a compiler that believes this is something to
warn about.
2013-02-15 15:57:47 -05:00
Nick Mathewson
b90f9ebbb2 Merge remote-tracking branch 'public/integers_donna' 2013-02-15 15:55:36 -05:00
Roger Dingledine
5d400b5f7f Authorities were adding downtime for every relay every restart
Stop marking every relay as having been down for one hour every
time we restart a directory authority. These artificial downtimes
were messing with our Stable and Guard flag calculations.

Fixes bug 8218 (introduced by the fix for 1035). Bugfix on 0.2.2.23-alpha.
2013-02-14 17:02:22 -05:00