summaryrefslogtreecommitdiff
path: root/src/or/circuitbuild.c
AgeCommit message (Collapse)Author
2012-03-09Never choose a bridge as an exit. Bug 5342.Nick Mathewson
2011-11-03Fix a memleak when fetching descriptors for bridges in ExcludeNodes.George Kadianakis
2011-09-28bridges should use create_fast cells for their own circuitsRoger Dingledine
fixes bug 4124, as noticed in bug 4115
2011-09-24Ticket #4063 - change circuit build timeout log entries from NOTICE to INFOTom Lowenthal
2011-08-30Use %f with printf-style formatting, not %lfNick Mathewson
For printf, %f and %lf are synonymous, since floats are promoted to doubles when passed as varargs. It's only for scanf that we need to say "%lf" for doubles and "%f" for floats. Apparenly, some older compilers think it's naughty to say %lf and like to spew warnings about it. Found by grarpamp.
2011-08-30Switch a SMARTLIST_FOREACH in circuitbuild.c to BEGIN/ENDNick Mathewson
It had some cpp stuff inside, and older GCCs don't like preprocessor directives inside macro arguments. Found by grarpamp.
2011-07-06appease check-spacesRoger Dingledine
2011-06-23Fix minor comment issuesRobert Ransom
2011-06-06Detect insanely large circuit build state; don't give its length to rand_intNick Mathewson
2011-05-31fix a bridge edge case similar to 2511Roger Dingledine
If you had configured a bridge but then switched to a different bridge via the controller, you would still be willing to use the old one.
2011-05-30Merge branch 'bug3045' into maint-0.2.2Nick Mathewson
Conflicts: src/or/circuitbuild.c
2011-05-29answer an XXX nickm asked in aa950e6c4Roger Dingledine
2011-05-23Fix GCC 4.6's new -Wunused-but-set-variable warnings.Nick Mathewson
Most instances were dead code; for those, I removed the assignments. Some were pieces of info we don't currently plan to use, but which we might in the future. For those, I added an explicit cast-to-void to indicate that we know that the thing's unused. Finally, one was a case where we were testing the wrong variable in a unit test. That one I fixed. This resolves bug 3208.
2011-05-20what's up with this trailing whitespaceRoger Dingledine
2011-05-17Handle NULL argument to get_configured_bridge_by_addr_port_digestNick Mathewson
Fixes bug 2313; bugfix on 0.2.2.26-beta.
2011-05-15Log descriptions of nodes, not just nicknames.Nick Mathewson
This patch introduces a few new functions in router.c to produce a more helpful description of a node than its nickame, and then tweaks nearly all log messages taking a nickname as an argument to call these functions instead. There are a few cases where I left the old log messages alone: in these cases, the nickname was that of an authority (whose nicknames are useful and unique), or the message already included an identity and/or an address. I might have missed a couple more too. This is a fix for bug 3045.
2011-05-15Preserve bridge download status across SETCONF, HUPNick Mathewson
This code changes it so that we don't remove bridges immediately when we start re-parsing our configuration. Instead, we mark them all, and remove all the marked ones after re-parsing our bridge lines. As we add a bridge, we see if it's already in the list. If so, we just unmark it. This new behavior will lose the property we used to have that bridges were in bridge_list in the same order in which they appeared in the torrc. I took a quick look through the code, and I'm pretty sure we didn't actually depend on that anywhere. This is for bug 3019; it's a fix on 0.2.0.3-alpha.
2011-05-11Merge remote-tracking branch 'public/3122_memcmp_squashed' into ↵Nick Mathewson
bug3122_memcmp_022 Conflicts throughout. All resolved in favor of taking HEAD and adding tor_mem* or fast_mem* ops as appropriate. src/common/Makefile.am src/or/circuitbuild.c src/or/directory.c src/or/dirserv.c src/or/dirvote.c src/or/networkstatus.c src/or/rendclient.c src/or/rendservice.c src/or/router.c src/or/routerlist.c src/or/routerparse.c src/or/test.c
2011-05-11Hand-conversion and audit phase of memcmp transitionNick Mathewson
Here I looked at the results of the automated conversion and cleaned them up as follows: If there was a tor_memcmp or tor_memeq that was in fact "safe"[*] I changed it to a fast_memcmp or fast_memeq. Otherwise if there was a tor_memcmp that could turn into a tor_memneq or tor_memeq, I converted it. This wants close attention. [*] I'm erring on the side of caution here, and leaving some things as tor_memcmp that could in my opinion use the data-dependent fast_memcmp variant.
2011-05-11Automated conversion of memcmp to tor_memcmp/tor_mem[n]eqNick Mathewson
This commit is _exactly_ the result of perl -i -pe 's/\bmemcmp\(/tor_memcmp\(/g' src/*/*.[ch] perl -i -pe 's/\!\s*tor_memcmp\(/tor_memeq\(/g' src/*/*.[ch] perl -i -pe 's/0\s*==\s*tor_memcmp\(/tor_memeq\(/g' src/*/*.[ch] perl -i -pe 's/0\s*!=\s*tor_memcmp\(/tor_memneq\(/g' src/*/*.[ch] git checkout src/common/di_ops.[ch] git checkout src/or/test.c git checkout src/common/test.h
2011-05-09Appease clang - and my tortured mindSebastian Hahn
This possible div by 0 warning from clang's analyzer was quite fun to track down. Turns out the current behaviour is safe.
2011-05-03Fix circuit_list_path_impl(): internal circuits do not have an "exit". ↵Nick Mathewson
Trivial fix for 3079.
2011-04-28stop putting wacky values into state->lastwrittenRoger Dingledine
2011-04-28fix a function commentRoger Dingledine
2011-04-27better user-facing warnings for unexpected last hopsRoger Dingledine
these still aren't perfect, but we won't know how to correct them until we start experiencing surprised users.
2011-04-27revert most of ef81649d2fcRoger Dingledine
Now we believe it to be the case that we never build a circuit for our stream that has an unsuitable exit, so we'll never need to use such a circuit. The risk is that we have some code that builds the circuit, but now we refuse to use it, meaning we just build a bazillion circuits and ignore them all.
2011-04-27Add a circuit_purpose_to_string() function, and use itNick Mathewson
We had a circuit_purpose_to_controller_string() function, but it was pretty coarse-grained and didn't try to be human-readable.
2011-04-26Explain the "using anyway" log message betterSebastian Hahn
Also add a request to report any cases where we are not honoring StrictNodes to the developers: These should now all be bugs.
2011-04-26If we have chosen an exit that shares a family with all bridges, fail the ↵Nick Mathewson
circuit We could probably do something smarter here, but the situation is unusual enough that it's okay to just fail the circuit.
2011-04-26Do not try to download descriptors for bridges in ExcludeNodes.Nick Mathewson
2011-04-26Do not automatically ignore Fast/Stable for exits when ExitNodes is setNick Mathewson
This once maybe made sense when ExitNodes meant "Here are 3 exits; use them all", but now it more typically means "Here are 3 countries; exit from there." Using non-Fast/Stable exits created a potential partitioning opportunity and an annoying stability problem. (Don't worry about the case where all of our ExitNodes are non-Fast or non-Stable: we handle that later in the function by retrying with need_capacity and need_uptime set to 0.)
2011-04-26Add an XXX022-1090 to note consider_exit_fmily b0rkennessNick Mathewson
2011-04-26three more cases where maybe we want to excludeRoger Dingledine
2011-04-26If ExitNodes and Exclude{Exit}Nodes overlap, obey Exclude{Exit}Nodes.Roger Dingledine
Also, ExitNodes are always strict.
2011-04-26the new entrynodes behavior is always strictRoger Dingledine
2011-04-26If EntryNodes and ExcludeNodes overlap, obey ExcludeNodes.Roger Dingledine
2011-04-07Merge remote-tracking branch 'public/xxx_fixups' into maint-0.2.2Nick Mathewson
Conflicts: src/or/or.h
2011-03-30Use timevals, not time_t, when expiring circuits.Nick Mathewson
We've got millisecond timers now, we might as well use them. This change won't actually make circuits get expiered with microsecond precision, since we only call the expiry functions once per second. Still, it should avoid the situation where we have a circuit get expired too early because of rounding. A couple of the expiry functions now call tor_gettimeofday: this should be cheap since we're only doing it once per second. If it gets to be called more often, though, we should onsider having the current time be an argument again.
2011-03-25Triage the XXX022 and XXX021 comments remaining in the codeNick Mathewson
Remove some, postpone others, leave some alone. Now the only remaining XXX022s are ones that seem important to fix or investigate.
2011-03-16Fix up all doxygen warnings other than "foo is not documented"Nick Mathewson
2011-03-14Merge remote branch 'arma/bug2510' into maint-0.2.2Nick Mathewson
2011-03-08Merge remote branch 'origin/maint-0.2.1' into maint-0.2.2Nick Mathewson
2011-03-08Avoid crash in any_pending_bridge_descriptor_fetchesNick Mathewson
This is based on shitlei's fix for bug2629, with extra parens removed. Fixes bug 2629, bugfix on 0.2.1.2-alpha.
2011-02-22prevent same entry and exit for insane edge caseRoger Dingledine
2011-02-08support multihomed bridges (bug 2510)Roger Dingledine
2011-01-26Merge branch 'bug2321' into maint-0.2.2Nick Mathewson
2011-01-26Avoid sketchy integer cast in cbt codeNick Mathewson
When calling circuit_build_times_shuffle_and_store_array, we were passing a uint32_t as an int. arma is pretty sure that this can't actually cause a bug, because of checks elsewhere in the code, but it's best not to pass a uint32_t as an int anyway. Found by doorss; fix on 0.2.2.4-alpha.
2011-01-25Comment remaining CBT functions.Mike Perry
Left circuit_build_times_get_bw_scale() uncommented because it is in the wrong place due to an improper bug2317 fix. It needs to be moved and renamed, as it is not a cbt parameter.
2011-01-25Fix bug #2004 by demoting a log message.Mike Perry
To quote arma: "So instead of stopping your CBT from screaming, you're just going to throw it in the closet and hope you can't hear it?" Yep. The log message can happen because at 95% point on the curve, we can be way beyond the max timeout we've seen, if the curve has few points and is shallow. Also applied Nick's rule of thumb for rewriting some other notice log messages to read like how you would explain them to a raving lunatic on #tor who was shouting at you demanding what they meant. Hopefully the changes live up to that standard.
2011-01-15Provide constant limits for all consensus paramsSebastian Hahn
This addresses Nick's concern about doing non-constant bounds checking inside networkstatus_get_param().