]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Figure out ORPort and DirPort even when 'auto' is used.
authorGeorge Kadianakis <desnacked@riseup.net>
Wed, 5 Sep 2012 17:17:25 +0000 (20:17 +0300)
committerGeorge Kadianakis <desnacked@riseup.net>
Wed, 5 Sep 2012 17:17:25 +0000 (20:17 +0300)
Use router_get_advertised_{dir,or}_port() functions instead of
get_primary_{dir,or}_port().

src/or/config.c

index a4af22a377f3e6a71415d267e6653e4f78cf6907..02afa1e27510c161f40b9a60a5fddc69495c7999 100644 (file)
@@ -7266,11 +7266,11 @@ get_list_of_ports_to_forward(void)
   /** XXX TODO tor-fw-helper does not support forwarding ports to
       other hosts than the local one. If the user is binding to a
       different IP address, tor-fw-helper won't work.  */
-  port = get_primary_or_port();  /* Get ORPort */
+  port = router_get_advertised_or_port(get_options());  /* Get ORPort */
   if (port)
     smartlist_add_asprintf(ports_to_forward, "%d:%d", port, port);
 
-  port = get_primary_dir_port(); /* Get DirPort */
+  port = router_get_advertised_dir_port(get_options(), 0); /* Get DirPort */
   if (port)
     smartlist_add_asprintf(ports_to_forward, "%d:%d", port, port);