summaryrefslogtreecommitdiff
path: root/src/or/routerparse.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2008-09-25 20:21:35 +0000
committerNick Mathewson <nickm@torproject.org>2008-09-25 20:21:35 +0000
commit8bbbbaf87b5ab3c0a5918d2bc8d1d7f22cf54f53 (patch)
tree9c9019d25cbba426218b1fd95560226e4e127cf1 /src/or/routerparse.c
parentb2c7090da6e0d01322d6f1590c46ca03e47f6e26 (diff)
downloadtor-8bbbbaf87b5ab3c0a5918d2bc8d1d7f22cf54f53.tar.gz
tor-8bbbbaf87b5ab3c0a5918d2bc8d1d7f22cf54f53.zip
Add country-code support to configured node lists to implement the ever-popular "no exits in Monaco" feature (ExcludeExitNodes {MC}). Also allow country codes and IP ranges in ExitNodes. (EntryNodes needs more work.) Based on code by Robert Hogan. Needs more testing.
svn:r16966
Diffstat (limited to 'src/or/routerparse.c')
-rw-r--r--src/or/routerparse.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/or/routerparse.c b/src/or/routerparse.c
index 00365cf4f7..5a8a17796a 100644
--- a/src/or/routerparse.c
+++ b/src/or/routerparse.c
@@ -1184,6 +1184,7 @@ router_parse_entry_from_string(const char *s, const char *end,
tor_assert(tok->n_args >= 5);
router = tor_malloc_zero(sizeof(routerinfo_t));
+ router->country = -1;
router->cache_info.routerlist_index = -1;
router->cache_info.annotations_len = s-start_of_annotations + prepend_len;
router->cache_info.signed_descriptor_len = end-s;
@@ -1388,6 +1389,8 @@ router_parse_entry_from_string(const char *s, const char *end,
"router descriptor") < 0)
goto err;
+ routerinfo_set_country(router);
+
if (!router->or_port) {
log_warn(LD_DIR,"or_port unreadable or 0. Failing.");
goto err;