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/router.c | |
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/router.c')
-rw-r--r-- | src/or/router.c | 7 |
1 files changed, 6 insertions, 1 deletions
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; |