[or-cvs] Set routerinfo->addr properly for own routerinfo; do casei ...

Nick Mathewson nickm at seul.org
Tue Apr 6 22:23:14 UTC 2004


Update of /home/or/cvsroot/src/or
In directory moria.mit.edu:/tmp/cvs-serv6019/or

Modified Files:
	connection_edge.c router.c routerlist.c 
Log Message:
Set routerinfo->addr properly for own routerinfo; do casei routerinfo compare

Index: connection_edge.c
===================================================================
RCS file: /home/or/cvsroot/src/or/connection_edge.c,v
retrieving revision 1.145
retrieving revision 1.146
diff -u -d -r1.145 -r1.146
--- connection_edge.c	6 Apr 2004 22:05:49 -0000	1.145
+++ connection_edge.c	6 Apr 2004 22:23:12 -0000	1.146
@@ -11,7 +11,6 @@
 static int connection_ap_handshake_process_socks(connection_t *conn);
 
 static int connection_exit_begin_conn(cell_t *cell, circuit_t *circ);
-static int connection_exit_set_rendezvous_addr_port(connection_t *conn);
 static void connection_edge_consider_sending_sendme(connection_t *conn);
 
 static uint32_t client_dns_lookup_entry(const char *address);

Index: router.c
===================================================================
RCS file: /home/or/cvsroot/src/or/router.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- router.c	5 Apr 2004 22:22:42 -0000	1.21
+++ router.c	6 Apr 2004 22:23:12 -0000	1.22
@@ -343,11 +343,16 @@
 
 int router_rebuild_descriptor(void) {
   routerinfo_t *ri;
+  struct in_addr addr;
+  if (!tor_inet_aton(options.Address, &addr)) {
+    log_fn(LOG_ERR, "options.Address didn't hold an IP.");
+    return -1;
+  }
 
   ri = tor_malloc_zero(sizeof(routerinfo_t));
   ri->address = tor_strdup(options.Address);
   ri->nickname = tor_strdup(options.Nickname);
-  /* No need to set addr. */
+  ri->addr = (uint32_t) addr.s_addr;
   ri->or_port = options.ORPort;
   ri->socks_port = options.SocksPort;
   ri->dir_port = options.DirPort;

Index: routerlist.c
===================================================================
RCS file: /home/or/cvsroot/src/or/routerlist.c,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -d -r1.53 -r1.54
--- routerlist.c	6 Apr 2004 20:16:12 -0000	1.53
+++ routerlist.c	6 Apr 2004 22:23:12 -0000	1.54
@@ -311,11 +311,11 @@
 
   for(i=0;i<routerlist->n_routers;i++) {
     router = routerlist->routers[i];
-    if (0 == strcmp(router->nickname, nickname))
+    if (0 == strcasecmp(router->nickname, nickname))
       return router;
   }
   router = router_get_my_routerinfo();
-  if (router && 0 == strcmp(router->nickname, nickname))
+  if (router && 0 == strcasecmp(router->nickname, nickname))
     return router;
 
   return NULL;



More information about the tor-commits mailing list