summaryrefslogtreecommitdiff
path: root/src/or/nodelist.c
AgeCommit message (Collapse)Author
2016-06-11Merge remote-tracking branch 'public/bug19203_027' into maint-0.2.8Nick Mathewson
2016-05-30Fix a warning on unnamed nodes in node_get_by_nickname().Nick Mathewson
There was a > that should have been an ==, and a missing !. These together prevented us from issuing a warning in the case that a nickname matched an Unnamed node only. Fixes bug 19203; bugfix on 0.2.3.1-alpha.
2016-02-27Update the copyright year.Nick Mathewson
2016-02-27Make sure that every module in src/or has a brief description.Nick Mathewson
2016-02-20If both IPv4 and IPv6 addresses could be used, choose one correctlyteor (Tim Wilson-Brown)
If there is a node, use node_ipv6_or/dir_preferred(). If there is no node, use fascist_firewall_prefer_ipv6_or/dirport().
2016-02-03Make bridge clients prefer the configured bridge addressteor (Tim Wilson-Brown)
When ClientPreferIPv6ORPort is auto, bridges prefer the configured bridge ORPort address. Otherwise, they use the value of the option. Other clients prefer IPv4 ORPorts if ClientPreferIPv6ORPort is auto. When ClientPreferIPv6DirPort is auto, all clients prefer IPv4 DirPorts.
2016-01-29Merge branch 'feature17840-v11-squashed' into feature17840-v11-mergedteor (Tim Wilson-Brown)
Conflicts: src/or/directory.c src/test/test_routerlist.c Fix minor conflicts.
2016-01-29Consistently format addresses in node_get_address_stringteor (Tim Wilson-Brown)
Also, don't write to a buffer with length zero.
2016-01-29Use fascist firewall and ClientUseIPv4 for bridge clientsteor (Tim Wilson-Brown)
Bridge clients ignore ClientUseIPv6, acting as if it is always 1. This preserves existing behaviour. Make ClientPreferIPv6OR/DirPort auto by default: * Bridge clients prefer IPv6 by default. * Other clients prefer IPv4 by default. This preserves existing behaviour.
2016-01-29Add ClientUseIPv4 and ClientPreferIPv6DirPort torrc optionsteor (Tim Wilson-Brown)
ClientUseIPv4 0 tells tor to avoid IPv4 client connections. ClientPreferIPv6DirPort 1 tells tor to prefer IPv6 directory connections. Refactor policy for IPv4/IPv6 preferences. Fix a bug where node->ipv6_preferred could become stale if ClientPreferIPv6ORPort was changed after the consensus was loaded. Update documentation, existing code, add unit tests.
2016-01-29Fix *_get_all_orports to use ipv6_orportteor (Tim Wilson-Brown)
node_get_all_orports and router_get_all_orports incorrectly used or_port with IPv6 addresses. They now use ipv6_orport. Also refactor and remove duplicated code.
2015-12-18Client should check if dir server has open dir port or handles tunnelled ↵Matthew Finkel
requests Final piece of prop 237. Closes 12538.
2015-12-15Replace usage of INLINE with inlinecypherpunks
This patch was generated using; sed -i -e "s/\bINLINE\b/inline/" src/*/*.[ch] src/*/*/*.[ch]
2015-07-31Improve log messages for problems about ed25519 keypinningNick Mathewson
Fixes 16286; bugfix on 0.2.7.2-alpha.
2015-02-23Avoid logging natural-language reports that are redundant with bootstrappingNick Mathewson
2015-02-19stop warning each time we check minimum-dir-infoRoger Dingledine
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-19don't update dir_info_status when we have minimum dir infoRoger Dingledine
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-18Fix bootstrap directory information logging.Yawning Angel
`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-18Fix compute_frac_paths_available, when ExitNodes is not set.Yawning Angel
2015-02-17Fix some issues with reporting exit-free networksNick Mathewson
Fixes bug 14918.
2015-01-02Bump copyright dates to 2015, in case someday this matters.Nick Mathewson
2014-12-30Allow tor to build circuits using a consensus with no exitsteor
If the consensus has no exits (typical of a bootstrapping test network), allow tor to build circuits once enough descriptors have been downloaded. When there are no exits, we always have "enough" exit descriptors. (We treat the proportion of available exit descriptors as 100%.) This assists in bootstrapping a testing Tor network. Fixes bug 13718. Makes bug 13161's TestingDirAuthVoteExit non-essential. (But still useful for speeding up a bootstrap.)
2014-12-30Check if there are exits in the consensusteor
Add router_have_consensus_path() which reports whether the consensus has exit paths, internal paths, or whether it just doesn't know. Used by #13718 and #13814.
2014-12-30Refactor count_usable_descriptors to use named enums for exit_onlyteor
count_usable_descriptors now uses named exit_only values: USABLE_DESCRIPTOR_ALL USABLE_DESCRIPTOR_EXIT_ONLY Add debug logging code for descriptor counts. This (hopefully) resolves nickm's request in bug 13718 to improve argument readability in nodelist.c.
2014-11-20Make can_complete_circuits a static variable.Nick Mathewson
2014-10-28Add another year to our copyright dates.Nick Mathewson
Because in 95 years, we or our successors will surely care about enforcing the BSD license terms on this code. Right?
2014-09-09Remove client-side bad directory logicSebastian Hahn
Implements the second half of #13060.
2014-09-02Another clang analyzer complaint wrt HT_GENERATENick Mathewson
We're calling mallocfn() and reallocfn() in the HT_GENERATE macro with the result of a product. But that makes any sane analyzer worry about overflow. This patch keeps HT_GENERATE having its old semantics, since we aren't the only project using ht.h. Instead, define a HT_GENERATE2 that takes a reallocarrayfn.
2014-08-29Introduce full coverage tests for module routerset.c.dana koch
This is using the paradigm introduced for test_status.c.
2014-08-06Build circuits more readily when DisableNetwork goes to 0Roger Dingledine
When Tor starts with DisabledNetwork set, it would correctly conclude that it shouldn't try making circuits, but it would mistakenly cache this conclusion and continue believing it even when DisableNetwork is set to 0. Fixes the bug introduced by the fix for bug 11200; bugfix on 0.2.5.4-alpha.
2014-06-02Merge remote-tracking branch 'public/bug12170_024_v2'Nick Mathewson
2014-06-02Avoid needless router_dir_info_has_changed from router_set_statusNick Mathewson
On some profiles of Andrea's from #11332, I found that a great deal of time can still be attributed to functions called from update_router_have_minimum_dir_info(). This is making our digestmap, tor_memeq, and siphash functions take a much bigger portion of runtime than they really should. If we're calling update_router_have_minimum_dir_info() too often, that's because we're calling router_dir_info_changed() too often. And it looks like most of the callers of router_dir_info_changed() are coming as tail-calls from router_set_status() as invoked by channel_do_open_actions(). But we don't need to call router_dir_info_changed() so much! (I'm not quite sure we need to call it from here at all, but...) Surely we don't need to call it from router_set_status when the router's status has not actually changed. This patch makes us call router_dir_info_changed() from router_set_status only when we are changing the router's status. Fix for bug 12170. This is leftover from our fix back in 273ee3e81 in 0.1.2.1-alpha, where we started caching the value of update_router_have_minimum_dir_info().
2014-05-01Fix a misuse of strlcpy() introduced by the #11156 patch.George Kadianakis
2014-04-15Uplift status.c unit test coverage with new test cases and macros.dana koch
A new set of unit test cases are provided, as well as introducing an alternative paradigm and macros to support it. Primarily, each test case is given its own namespace, in order to isolate tests from each other. We do this by in the usual fashion, by appending module and submodule names to our symbols. New macros assist by reducing friction for this and other tasks, like overriding a function in the global namespace with one in the current namespace, or declaring integer variables to assist tracking how many times a mock has been called. A set of tests for a small-scale module has been included in this commit, in order to highlight how the paradigm can be used. This suite gives 100% coverage to status.c in test execution.
2014-03-27Merge branch 'bug7164_diagnose_harder_v2'Nick Mathewson
2014-03-27More logs to try to diagnose bug 7164Nick Mathewson
This time, check in microdesc_cache_clean() to see what could be going wrong with an attempt to clean a microdesc that's held by a node.
2014-03-10Merge branch 'bug11156_squashed'Nick Mathewson
2014-03-10Don't do directory fetches before all PTs have been configured.George Kadianakis
2014-03-05Merge remote-tracking branch 'arma/ticket5528'Nick Mathewson
Conflicts: src/or/router.c src/test/test_dir.c
2014-02-12Siphash-2-4 is now our hash in nearly all cases.Nick Mathewson
I've made an exception for cases where I'm sure that users can't influence the inputs. This is likely to cause a slowdown somewhere, but it's safer to siphash everything and *then* look for cases to optimize. This patch doesn't actually get us any _benefit_ from siphash yet, since we don't really randomize the key at any point.
2014-02-07Merge remote-tracking branch 'houqp/hs_control_fix'Nick Mathewson
2014-02-06Merge remote-tracking branch 'public/bug10543_024_v2'Nick Mathewson
2014-02-06Make the handling for usable-exit counting handle ExitNodes betterNick Mathewson
It's possible to set your ExitNodes to contains only exits that don't have the Exit flag. If you do that, we'll decide that 0 of your exits are working. Instead, in that case we should look at nodes which have (or which might have) exit policies that don't reject everything. Fix for bug 10543; bugfix on 0.2.4.10-alpha.
2014-02-06fix longname returned in HS_DESC control eventsQingping Hou
According to control spec, longname should not contain any spaces and is consists only of identy_digest + nickname added two functions: * node_get_verbose_nickname_by_id() * node_describe_longname_by_id()
2014-01-29Rip out all of the v2 directory code.Nick Mathewson
The remaining vestige is that we continue to publish the V2dir flag, and that, for the controller, we continue to emit v2 directory formats when requested.
2013-10-10Report bootstrapping progress correctly when downloading microdescsRoger Dingledine
We had updated our "do we have enough microdescs to begin building circuits?" logic most recently in 0.2.4.10-alpha (see bug 5956), but we left the bootstrap status event logic at "how far through getting 1/4 of them are we?" Fixes bug 9958; bugfix on 0.2.2.36, which is where they diverged (see bug 5343).
2013-03-28Make PathsNeededToBuildCircuits option work.Karsten Loesing
2013-03-11On END_REASON_EXITPOLICY, mark circuit as unusable for that address.Nick Mathewson
Also, don't call the exit node 'reject *' unless our decision to pick that node was based on a non-summarized version of that node's exit policy. rransom and arma came up with the ideas for this fix. Fix for 7582; the summary-related part is a bugfix on 0.2.3.2-alpha.
2013-02-09use router->addr for log messages and controller eventsRoger Dingledine
(rather than router->address)
2013-02-04Quick fix on 5956 for authoritiesNick Mathewson
Authorities don't set is_possible_guard on node_t, so they were never deciding that they could build enough paths. This is a quick and dirty fix. Bug not in any released version of Tor