]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Become an exit relay if IPv6Exit is 1
authorNeel Chauhan <neel@neelc.org>
Fri, 12 Apr 2019 00:21:51 +0000 (20:21 -0400)
committerNeel Chauhan <neel@neelc.org>
Sun, 14 Apr 2019 16:48:07 +0000 (12:48 -0400)
src/core/or/policies.c

index a6d66d36decb96404ceacd1743792f8cc2b54769..ab320dd2ca775114e588a461fb5fc10f1be578b5 100644 (file)
@@ -1182,9 +1182,9 @@ validate_addr_policies(const or_options_t *options, char **msg)
 
   static int warned_about_nonexit = 0;
 
-  if (public_server_mode(options) &&
-      !warned_about_nonexit && options->ExitPolicy == NULL &&
-      options->ExitRelay == -1 && options->ReducedExitPolicy == 0) {
+  if (public_server_mode(options) && !warned_about_nonexit &&
+      options->ExitPolicy == NULL && options->ExitRelay == -1 &&
+      options->ReducedExitPolicy == 0 && options->IPv6Exit == 0) {
     warned_about_nonexit = 1;
     log_notice(LD_CONFIG, "By default, Tor does not run as an exit relay. "
                "If you want to be an exit relay, "
@@ -2142,8 +2142,9 @@ policies_parse_exit_policy_from_options(const or_options_t *or_options,
 
   /* Short-circuit for non-exit relays, or for relays where we didn't specify
    * ExitPolicy or ReducedExitPolicy and ExitRelay is auto. */
-  if (or_options->ExitRelay == 0 || (or_options->ExitPolicy == NULL &&
-      or_options->ExitRelay == -1 && or_options->ReducedExitPolicy == 0)) {
+  if (or_options->ExitRelay == 0 ||
+      (or_options->ExitPolicy == NULL && or_options->ExitRelay == -1 &&
+       or_options->ReducedExitPolicy == 0 && or_options->IPv6Exit == 0)) {
     append_exit_policy_string(result, "reject *4:*");
     append_exit_policy_string(result, "reject *6:*");
     return 0;