diff options
author | Nick Mathewson <nickm@torproject.org> | 2020-07-01 16:27:12 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2020-07-01 16:27:12 -0400 |
commit | 538b25241e9f2112e3a56449ba07c08f265f22f9 (patch) | |
tree | a0b8f953aba9becf364be08944141c419fea9cef /src/app/config/resolve_addr.c | |
parent | f152d5b15f50972c69021f386a806587d91a0654 (diff) | |
parent | b14b1f2b1d92b7f0e605c312fc59c42a48dea7dd (diff) | |
download | tor-538b25241e9f2112e3a56449ba07c08f265f22f9.tar.gz tor-538b25241e9f2112e3a56449ba07c08f265f22f9.zip |
Merge remote-tracking branch 'dgoulet/ticket33235_045_01'
Diffstat (limited to 'src/app/config/resolve_addr.c')
-rw-r--r-- | src/app/config/resolve_addr.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/app/config/resolve_addr.c b/src/app/config/resolve_addr.c index bf462c2024..167a4aa4dd 100644 --- a/src/app/config/resolve_addr.c +++ b/src/app/config/resolve_addr.c @@ -193,6 +193,10 @@ get_address_from_config(const or_options_t *options, int warn_severity, explicit_ip = true; num_valid_addr++; continue; + } else if (af != -1) { + /* Parsable address but just not the one from the family we want. Skip + * it so we don't attempt a resolve. */ + continue; } /* Not an IP address. Considering this value a hostname and attempting to @@ -208,7 +212,7 @@ get_address_from_config(const or_options_t *options, int warn_severity, /* Hostname that can't be resolved, this is a fatal error. */ log_fn(warn_severity, LD_CONFIG, "Could not resolve local Address '%s'. Failing.", cfg->value); - return FN_RET_BAIL; + continue; } } @@ -216,8 +220,10 @@ get_address_from_config(const or_options_t *options, int warn_severity, log_fn(warn_severity, LD_CONFIG, "No Address option found for family %s in configuration.", fmt_af_family(family)); - /* No Address statement for family, inform caller to try next method. */ - return FN_RET_NEXT; + /* No Address statement for family but one exists since Address is not + * NULL thus we have to stop now and not attempt to send back a guessed + * address. */ + return FN_RET_BAIL; } if (num_valid_addr >= MAX_CONFIG_ADDRESS) { |