diff options
author | Roger Dingledine <arma@torproject.org> | 2004-03-15 04:04:16 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2004-03-15 04:04:16 +0000 |
commit | 70cc557a181c168c3f6de899a8f901f904998ea7 (patch) | |
tree | 0e2edb55d65444716e221dd3d5ef569bab87970d | |
parent | be18884765d1e59b3c444679da410d955433116b (diff) | |
download | tor-70cc557a181c168c3f6de899a8f901f904998ea7.tar tor-70cc557a181c168c3f6de899a8f901f904998ea7.tar.gz |
only complain about private IPs if we had to guess
svn:r1279
-rw-r--r-- | src/or/config.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/or/config.c b/src/or/config.c index 8b7300310..69aea254c 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -349,8 +349,10 @@ static int resolve_my_address(or_options_t *options) { struct in_addr in; struct hostent *rent; char localhostname[256]; + int guessed=0; if(!options->Address) { /* then we need to guess our address */ + guessed = 1; if(gethostname(localhostname,sizeof(localhostname)) < 0) { log_fn(LOG_WARN,"Error obtaining local hostname"); @@ -376,7 +378,7 @@ static int resolve_my_address(or_options_t *options) { } assert(rent->h_length == 4); memcpy(&in.s_addr, rent->h_addr,rent->h_length); - if(is_internal_IP(htonl(in.s_addr))) { + if(guessed==1 && is_internal_IP(htonl(in.s_addr))) { log_fn(LOG_WARN,"Address '%s' resolves to private IP '%s'. " "Please set the Address config option to be your public IP.", options->Address, inet_ntoa(in)); |