diff options
author | David Goulet <dgoulet@torproject.org> | 2020-06-30 12:13:23 -0400 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2020-06-30 12:13:23 -0400 |
commit | b14b1f2b1d92b7f0e605c312fc59c42a48dea7dd (patch) | |
tree | b560257cb44008d70a359c0737f1acaf727d0ff6 /src/app | |
parent | 6f1423cb57b35525babb08fe317df126f7363b46 (diff) | |
download | tor-b14b1f2b1d92b7f0e605c312fc59c42a48dea7dd.tar.gz tor-b14b1f2b1d92b7f0e605c312fc59c42a48dea7dd.zip |
addr: Don't guess our address if no Address lines are valid
If at least one Address line is given but invalid, we should not attempt to
guess our address.
This commit sends back the "bail" signal so find_my_address() can return an
error if the requested family doesn't exists but still an Address line is
found which is likely another family.
Fixed in #33235
Related to #33233
Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/app')
-rw-r--r-- | src/app/config/resolve_addr.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/app/config/resolve_addr.c b/src/app/config/resolve_addr.c index 9c208efea3..0070cf7ecf 100644 --- a/src/app/config/resolve_addr.c +++ b/src/app/config/resolve_addr.c @@ -220,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) { |