From ac5893c62675ac0f25538c5b231dd3cd287eb4d9 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Wed, 30 Jul 2003 19:12:03 +0000 Subject: src/or svn:r371 --- src/or/routers.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/or/routers.c') 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; } -- cgit v1.2.3-54-g00ecf