]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Avoid false positives from proxy_mode()
authorNick Mathewson <nickm@torproject.org>
Thu, 28 Apr 2011 21:45:41 +0000 (17:45 -0400)
committerNick Mathewson <nickm@torproject.org>
Thu, 28 Apr 2011 22:11:58 +0000 (18:11 -0400)
Previously it would erroneously return true if ListenAddr was set for
a client port, even if that port itself was 0.  This would give false
positives, which were not previously harmful... but which were about
to become.

src/or/router.c

index 0ef4728a027b2fa507145e397cb281d38657fdc2..65afd49f7f8d1537d11cf89c5e56641b5eb25d92 100644 (file)
@@ -1107,10 +1107,10 @@ set_server_advertised(int s)
 int
 proxy_mode(or_options_t *options)
 {
-  return (options->SocksPort != 0 || options->SocksListenAddress ||
-          options->TransPort != 0 || options->TransListenAddress ||
-          options->NATDPort != 0 || options->NATDListenAddress ||
-          options->DNSPort != 0 || options->DNSListenAddress);
+  return (options->SocksPort != 0 ||
+          options->TransPort != 0 ||
+          options->NATDPort != 0 ||
+          options->DNSPort != 0);
 }
 
 /** Decide if we're a publishable server. We are a publishable server if: