[tor-commits] [tor/master] Move parse logic for outbound addresses to before we handle PT's.

dgoulet at torproject.org dgoulet at torproject.org
Tue Oct 6 13:42:10 UTC 2020


commit 69c1a4ebc369d79b2a58c25926187407a34b511e
Author: Alexander Færøy <ahf at torproject.org>
Date:   Tue Jul 2 20:18:19 2019 +0200

    Move parse logic for outbound addresses to before we handle PT's.
    
    This patch moves the logic for handling outbound addresses in torrc to
    before we handle pluggable transports. Since we need access to the
    values in OutboundBindAddress and friends for #5304 we have to parse
    these values before we spawn any PT's.
    
    This commit is code movement only.
    
    See: https://bugs.torproject.org/5304
---
 src/app/config/config.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/app/config/config.c b/src/app/config/config.c
index 46d98b2ab2..0706a0dbdc 100644
--- a/src/app/config/config.c
+++ b/src/app/config/config.c
@@ -2105,6 +2105,16 @@ options_act,(const or_options_t *old_options))
              "in a non-anonymous mode. It will provide NO ANONYMITY.");
   }
 
+  /* 31851: OutboundBindAddressExit is relay-only */
+  if (parse_outbound_addresses(options, 0, &msg) < 0) {
+    // LCOV_EXCL_START
+    log_warn(LD_BUG, "Failed parsing previously validated outbound "
+             "bind addresses: %s", msg);
+    tor_free(msg);
+    return -1;
+    // LCOV_EXCL_STOP
+  }
+
   if (options->Bridges) {
     mark_bridge_list();
     for (cl = options->Bridges; cl; cl = cl->next) {
@@ -2266,16 +2276,6 @@ options_act,(const or_options_t *old_options))
     tor_free(http_authenticator);
   }
 
-  /* 31851: OutboundBindAddressExit is relay-only */
-  if (parse_outbound_addresses(options, 0, &msg) < 0) {
-    // LCOV_EXCL_START
-    log_warn(LD_BUG, "Failed parsing previously validated outbound "
-             "bind addresses: %s", msg);
-    tor_free(msg);
-    return -1;
-    // LCOV_EXCL_STOP
-  }
-
   config_maybe_load_geoip_files_(options, old_options);
 
   if (geoip_is_loaded(AF_INET) && options->GeoIPExcludeUnknown) {





More information about the tor-commits mailing list