[or-cvs] don"t pick administrative-friends when picking your path
Roger Dingledine
arma at seul.org
Fri Sep 10 21:40:31 UTC 2004
Update of /home/or/cvsroot/src/or
In directory moria.mit.edu:/home2/arma/work/onion/cvs/src/or
Modified Files:
circuitbuild.c config.c or.h routerlist.c
Log Message:
don't pick administrative-friends when picking your path
(just a skeleton for now)
Index: circuitbuild.c
===================================================================
RCS file: /home/or/cvsroot/src/or/circuitbuild.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -d -r1.33 -r1.34
--- circuitbuild.c 20 Aug 2004 21:34:36 -0000 1.33
+++ circuitbuild.c 10 Sep 2004 21:40:28 -0000 1.34
@@ -1074,14 +1074,19 @@
log_fn(LOG_DEBUG, "Contemplating intermediate hop: random choice.");
excluded = smartlist_create();
- if((r = router_get_by_digest(state->chosen_exit_digest)))
+ if((r = router_get_by_digest(state->chosen_exit_digest))) {
smartlist_add(excluded, r);
- if((r = routerlist_find_my_routerinfo()))
+ routerlist_add_friends(excluded, r);
+ }
+ if((r = routerlist_find_my_routerinfo())) {
smartlist_add(excluded, r);
+ routerlist_add_friends(excluded, r);
+ }
for (i = 0, cpath = head; i < cur_len; ++i, cpath=cpath->next) {
r = router_get_by_digest(cpath->identity_digest);
tor_assert(r);
smartlist_add(excluded, r);
+ routerlist_add_friends(excluded, r);
}
choice = router_choose_random_node("", options.ExcludeNodes, excluded,
0, 1, options._AllowUnverified & ALLOW_UNVERIFIED_MIDDLE, 0);
@@ -1095,10 +1100,14 @@
smartlist_t *excluded = smartlist_create();
char buf[16];
- if((r = router_get_by_digest(state->chosen_exit_digest)))
+ if((r = router_get_by_digest(state->chosen_exit_digest))) {
smartlist_add(excluded, r);
- if((r = routerlist_find_my_routerinfo()))
+ routerlist_add_friends(excluded, r);
+ }
+ if((r = routerlist_find_my_routerinfo())) {
smartlist_add(excluded, r);
+ routerlist_add_friends(excluded, r);
+ }
if(options.FascistFirewall) {
/* exclude all ORs that listen on the wrong port */
routerlist_t *rl;
Index: config.c
===================================================================
RCS file: /home/or/cvsroot/src/or/config.c,v
retrieving revision 1.156
retrieving revision 1.157
diff -u -d -r1.156 -r1.157
--- config.c 10 Sep 2004 19:16:01 -0000 1.156
+++ config.c 10 Sep 2004 21:40:28 -0000 1.157
@@ -1045,7 +1045,8 @@
if (d && strncmp(d,"~/",2)==0) {
char *fn = expand_filename(d);
if(!fn) {
- /* XXX complain and exit(1) here */
+ log_fn(LOG_ERR,"Failed to expand filename '%s'. Exiting.",d);
+ exit(1);
}
tor_free(options->DataDirectory);
options->DataDirectory = fn;
Index: or.h
===================================================================
RCS file: /home/or/cvsroot/src/or/or.h,v
retrieving revision 1.417
retrieving revision 1.418
diff -u -d -r1.417 -r1.418
--- or.h 8 Sep 2004 06:52:33 -0000 1.417
+++ or.h 10 Sep 2004 21:40:28 -0000 1.418
@@ -1394,6 +1394,7 @@
routerinfo_t *router_pick_directory_server(int requireauth, int requireothers);
int all_directory_servers_down(void);
struct smartlist_t;
+void routerlist_add_friends(struct smartlist_t *sl, routerinfo_t *router);
void add_nickname_list_to_smartlist(struct smartlist_t *sl, const char *list, int warn_if_down);
routerinfo_t *routerlist_find_my_routerinfo(void);
int router_nickname_matches(routerinfo_t *router, const char *nickname);
Index: routerlist.c
===================================================================
RCS file: /home/or/cvsroot/src/or/routerlist.c,v
retrieving revision 1.136
retrieving revision 1.137
diff -u -d -r1.136 -r1.137
--- routerlist.c 8 Sep 2004 07:16:34 -0000 1.136
+++ routerlist.c 10 Sep 2004 21:40:29 -0000 1.137
@@ -175,6 +175,13 @@
return 1;
}
+/** Add all the friends of <b>router</b> to the smartlist <b>sl</b>.
+ */
+void routerlist_add_friends(smartlist_t *sl, routerinfo_t *router) {
+
+
+}
+
/** Given a comma-and-whitespace separated list of nicknames, see which
* nicknames in <b>list</b> name routers in our routerlist that are
* currently running. Add the routerinfos for those routers to <b>sl</b>.
More information about the tor-commits
mailing list