[tor-commits] [tor/master] Remove redundant boolean expression from firewall_is_fascist_impl()

nickm at torproject.org nickm at torproject.org
Fri Jan 13 21:55:12 UTC 2017


commit 2debcc869fa6672d85b238a03ab0988ac74547e4
Author: teor <teor2345 at gmail.com>
Date:   Fri Dec 16 22:43:46 2016 +1100

    Remove redundant boolean expression from firewall_is_fascist_impl()
    
    Let A = UseBridges
    Let B = ClientUseIPv4
    
    Then firewall_is_fascist_impl expands and simplifies to:
    B || (!(A || ...) && A)
    B || (!A && ... && A)
    B || 0
    B
---
 src/or/policies.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/or/policies.c b/src/or/policies.c
index ac57e72..84600f7 100644
--- a/src/or/policies.c
+++ b/src/or/policies.c
@@ -317,10 +317,8 @@ firewall_is_fascist_impl(void)
   const or_options_t *options = get_options();
   /* Assume every non-bridge relay has an IPv4 address.
    * Clients which use bridges may only know the IPv6 address of their
-   * bridge. */
-  return (options->ClientUseIPv4 == 0
-          || (!fascist_firewall_use_ipv6(options)
-              && options->UseBridges == 1));
+   * bridge, but they will connect regardless of the ClientUseIPv6 setting. */
+  return options->ClientUseIPv4 == 0;
 }
 
 /** Return true iff the firewall options, including ClientUseIPv4 0 and





More information about the tor-commits mailing list