[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [tor/master] addr: Only attempt Address resolution on non parsable lines
commit a8b8a1ee99fa843a5937b4d2a5973c444a4311e0
Author: David Goulet <dgoulet@xxxxxxxxxxxxxx>
Date: Tue Jun 30 12:05:56 2020 -0400
addr: Only attempt Address resolution on non parsable lines
In get_address_from_config(), we would attempt to resolve an Address line that
is not from the requested family but that line could be a valid address from
another family (v4 vs v6).
This makes it that we don't attempt to resolve a valid address from another
family.
Found with unit test config/find_my_address_mixed.
Fixed in #33235
Related to #33233
Signed-off-by: David Goulet <dgoulet@xxxxxxxxxxxxxx>
---
src/app/config/resolve_addr.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/app/config/resolve_addr.c b/src/app/config/resolve_addr.c
index c8b44de84..61662c340 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
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits