diff options
author | Nick Mathewson <nickm@torproject.org> | 2004-04-06 22:23:12 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2004-04-06 22:23:12 +0000 |
commit | fdb58e8ea3eeccc48db1881926b43dcec211c9de (patch) | |
tree | 15de60cce068b3052d5e3870ba6bae1d1f0818a9 /src/or | |
parent | f24519e4b9aeb39cbed50283936b86220c199e81 (diff) | |
download | tor-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.c | 1 | ||||
-rw-r--r-- | src/or/router.c | 7 | ||||
-rw-r--r-- | src/or/routerlist.c | 4 |
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; |