summaryrefslogtreecommitdiff
path: root/src/or/routers.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2003-07-30 19:12:03 +0000
committerNick Mathewson <nickm@torproject.org>2003-07-30 19:12:03 +0000
commitac5893c62675ac0f25538c5b231dd3cd287eb4d9 (patch)
treef959e277ee907e9768b1b8c8c67034839948fb13 /src/or/routers.c
parentf12fdd62aa9ac5561dc2133a2110c3f9dd42900c (diff)
downloadtor-ac5893c62675ac0f25538c5b231dd3cd287eb4d9.tar.gz
tor-ac5893c62675ac0f25538c5b231dd3cd287eb4d9.zip
src/or
svn:r371
Diffstat (limited to 'src/or/routers.c')
-rw-r--r--src/or/routers.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/or/routers.c b/src/or/routers.c
index 06d7e2c793..f4d059d9cc 100644
--- a/src/or/routers.c
+++ b/src/or/routers.c
@@ -58,7 +58,11 @@ int learn_my_address(struct sockaddr_in *me) {
memcpy((void *)&me->sin_addr,(void *)localhost->h_addr,sizeof(struct in_addr));
me->sin_port = htons(options.ORPort);
log_fn(LOG_DEBUG,"chose address as '%s'.",inet_ntoa(me->sin_addr));
-
+ if (!strncmp("127.",inet_ntoa(me->sin_addr), 4) &&
+ strcasecmp(localhostname, "localhost")) {
+ /* We're a loopback IP but we're not called localhost. Uh oh! */
+ log_fn(LOG_WARNING, "Got a loopback address: /etc/hosts may be wrong");
+ }
return 0;
}