aboutsummaryrefslogtreecommitdiff
path: root/src/or/nodelist.c
Commit message (Expand)AuthorAge
* Make sure the microdesc cache is loaded before setting a v3 md consensus•••Otherwise, we can wind up munging our reference counts if we set it in the middle of loading the nodes. This happens because nodelist_set_consensus() and microdesc_reload_cache() are both in the business of adjusting microdescriptors' references. Nick Mathewson2011-09-28
* Fix a crash bug in tor_assert(md->held_by_node)•••The fix is to turn held_by_node into a reference count. Fixes bug 4118; bugfix on 0.2.3.1-alpha. Nick Mathewson2011-09-28
* Make nodelist_purge avoid orphaned microdescs in rs-less nodes•••We have an invariant that a node_t should have an md only if it has a routerstatus. nodelist_purge tried to preserve this by removing all nodes without a routerstatus or a routerinfo. But this left nodes with a routerinfo and a microdesc untouched, even if they had a routerstatus. Bug found by frosty_un. Nick Mathewson2011-07-07
* Merge remote-tracking branch 'public/bug3153'•••Conflicts: src/or/nodelist.c Nick Mathewson2011-07-07
|\
| * Track where microdescs are referenced to prevent free errs•••On IRC, wanoskarnet notes that if we ever do microdesc_free() on a microdesc that's in the nodelist, we're in trouble. Also, we're in trouble if we free one that's still in the microdesc_cache map. This code adds a flag to microdesc_t to note where the microdesc is referenced from, and checks those flags from microdesc_free(). I don't believe we have any errors here now, but if we introduce some later, let's log and recover from them rather than introducing heisenbugs later on. Addresses bug 3153. Nick Mathewson2011-05-12
* | Make the get_options() return const•••This lets us make a lot of other stuff const, allows the compiler to generate (slightly) better code, and will make me get slightly fewer patches from folks who stick mutable stuff into or_options_t. const: because not every input is an output! Nick Mathewson2011-06-14
* | Fix a memleak in nodelist_assert_ok()Sebastian Hahn2011-06-08
* | Hand-tune the new tor_memcmp instances in 0.2.3Nick Mathewson2011-05-11
* | Reapply the automated memcmp conversion to 0.2.3 to catch newly added memcmpsNick Mathewson2011-05-11
|/
* Bump copyright statements to 2011 (master)Nick Mathewson2011-01-03
* Remove a ??? comment in node_get_by_nickname•••Bug 1859 shows that the router_get_by_nickname behavior was wrong, and the node_get_by_nickname is right. Nick Mathewson2010-10-21
* Add a node_get_by_hex_id().Nick Mathewson2010-10-21
* Make check-spaces happySebastian Hahn2010-10-14
* Implement node_set_exit_policy_to_reject_all with a flag•••Also remove some debugging code. Nick Mathewson2010-10-13
* Fix a couple more node_t-related nullpointer bugsNick Mathewson2010-10-04
* More debugging code for node_t branchNick Mathewson2010-10-01
* Implement policies for nodes (and for microdescriptors too)Nick Mathewson2010-10-01
* Implement a few more node-based functions•••Some of these functions only work for routerinfo-based nodes, and as such are only usable for advisory purposes. Fortunately, our uses of them are compatible with this limitation. Nick Mathewson2010-10-01
* Implement node-based router family code•••Also, make the NodeFamily option into a list of routersets. This lets us git rid of router_in_nickname_list (or whatever it was called) without porting it to work with nodes, and also lets people specify country codes and IP ranges in NodeFamily Nick Mathewson2010-10-01
* Rename routerstatus_t.is_running to is_flagged_running•••This was the only flag in routerstatus_t that we would previously change in a routerstatus_t in a consensus. We no longer have reason to do so -- and probably never did -- as you can now confirm more easily than you could have done by grepping for is_running before this patch. The name change is to emphasize that the routerstatus_t is_running flag is only there to tell you whether the consensus says it's running, not whether it *you* think it's running. Nick Mathewson2010-10-01
* Initial conversion to use node_t throughout our codebase.•••A node_t is an abstraction over routerstatus_t, routerinfo_t, and microdesc_t. It should try to present a consistent interface to all of them. There should be a node_t for a server whenever there is * A routerinfo_t for it in the routerlist * A routerstatus_t in the current_consensus. (note that a microdesc_t alone isn't enough to make a node_t exist, since microdescriptors aren't usable on their own.) There are three ways to get a node_t right now: looking it up by ID, looking it up by nickname, and iterating over the whole list of microdescriptors. All (or nearly all) functions that are supposed to return "a router" -- especially those used in building connections and circuits -- should return a node_t, not a routerinfo_t or a routerstatus_t. A node_t should hold all the *mutable* flags about a node. This patch moves the is_foo flags from routerinfo_t into node_t. The flags in routerstatus_t remain, but they get set from the consensus and should not change. Some other highlights of this patch are: * Looking up routerinfo and routerstatus by nickname is now unified and based on the "look up a node by nickname" function. This tries to look only at the values from current consensus, and not get confused by the routerinfo_t->is_named flag, which could get set for other weird reasons. This changes the behavior of how authorities (when acting as clients) deal with nodes that have been listed by nickname. * I tried not to artificially increase the size of the diff here by moving functions around. As a result, some functions that now operate on nodes are now in the wrong file -- they should get moved to nodelist.c once this refactoring settles down. This moving should happen as part of a patch that moves functions AND NOTHING ELSE. * Some old code is now left around inside #if 0/1 blocks, and should get removed once I've verified that I don't want it sitting around to see how we used to do things. There are still some unimplemented functions: these are flagged with "UNIMPLEMENTED_NODELIST()." I'll work on filling in the implementation here, piece by piece. I wish this patch could have been smaller, but there did not seem to be any piece of it that was independent from the rest. Moving flags forces many functions that once returned routerinfo_t * to return node_t *, which forces their friends to change, and so on. Nick Mathewson2010-10-01
* Try to make most routerstatus_t interfaces constNick Mathewson2010-10-01
* Implement a basic node and nodelist type•••The node_t type is meant to serve two key functions: 1) Abstracting difference between routerinfo_t and microdesc_t so that clients can use microdesc_t instead of routerinfo_t. 2) Being a central place to hold mutable state about nodes formerly held in routerstatus_t and routerinfo_t. This patch implements a nodelist type that holds a node for every router that we would consider using. Nick Mathewson2010-10-01