aboutsummaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2004-04-06 22:23:12 +0000
committerNick Mathewson <nickm@torproject.org>2004-04-06 22:23:12 +0000
commitfdb58e8ea3eeccc48db1881926b43dcec211c9de (patch)
tree15de60cce068b3052d5e3870ba6bae1d1f0818a9 /src/or
parentf24519e4b9aeb39cbed50283936b86220c199e81 (diff)
downloadtor-fdb58e8ea3eeccc48db1881926b43dcec211c9de.tar
tor-fdb58e8ea3eeccc48db1881926b43dcec211c9de.tar.gz
Set routerinfo->addr properly for own routerinfo; do casei routerinfo compare
svn:r1514
Diffstat (limited to 'src/or')
-rw-r--r--src/or/connection_edge.c1
-rw-r--r--src/or/router.c7
-rw-r--r--src/or/routerlist.c4
3 files changed, 8 insertions, 4 deletions
diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c
index ac47c8f81..a543e22e7 100644
--- a/src/or/connection_edge.c
+++ b/src/or/connection_edge.c
@@ -11,7 +11,6 @@ extern char *conn_state_to_string[][_CONN_TYPE_MAX+1];
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);
diff --git a/src/or/router.c b/src/or/router.c
index 0fcf1b2bd..9ca940022 100644
--- a/src/or/router.c
+++ b/src/or/router.c
@@ -343,11 +343,16 @@ const char *router_get_my_descriptor(void) {
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;
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index 0f29b34e7..526559c9f 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -311,11 +311,11 @@ routerinfo_t *router_get_by_nickname(char *nickname)
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;