[tor-commits] [tor/master] config: Delete get_list_of_ports_to_forward()

teor at torproject.org teor at torproject.org
Tue Nov 5 04:28:52 UTC 2019


commit d6654580851425a67686de2122cd6978e2809667
Author: teor <teor at torproject.org>
Date:   Wed Oct 30 16:50:20 2019 +1000

    config: Delete get_list_of_ports_to_forward()
    
    Tor has not supported automatic port forwarding for some time.
---
 src/app/config/config.c | 37 -------------------------------------
 src/app/config/config.h |  2 --
 2 files changed, 39 deletions(-)

diff --git a/src/app/config/config.c b/src/app/config/config.c
index e568d0a58..0fda62d4d 100644
--- a/src/app/config/config.c
+++ b/src/app/config/config.c
@@ -6890,43 +6890,6 @@ write_to_data_subdir(const char* subdir, const char* fname,
   return return_val;
 }
 
-/** Return a smartlist of ports that must be forwarded by
- *  tor-fw-helper. The smartlist contains the ports in a string format
- *  that is understandable by tor-fw-helper. */
-smartlist_t *
-get_list_of_ports_to_forward(void)
-{
-  smartlist_t *ports_to_forward = smartlist_new();
-  int port = 0;
-
-  /** 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 = router_get_advertised_or_port(get_options());  /* Get ORPort */
-  if (port)
-    smartlist_add_asprintf(ports_to_forward, "%d:%d", port, port);
-
-  port = router_get_advertised_dir_port(get_options(), 0); /* Get DirPort */
-  if (port)
-    smartlist_add_asprintf(ports_to_forward, "%d:%d", port, port);
-
-  /* Get ports of transport proxies */
-  {
-    smartlist_t *transport_ports = get_transport_proxy_ports();
-    if (transport_ports) {
-      smartlist_add_all(ports_to_forward, transport_ports);
-      smartlist_free(transport_ports);
-    }
-  }
-
-  if (!smartlist_len(ports_to_forward)) {
-    smartlist_free(ports_to_forward);
-    ports_to_forward = NULL;
-  }
-
-  return ports_to_forward;
-}
-
 /** Helper to implement GETINFO functions about configuration variables (not
  * their values).  Given a "config/names" question, set *<b>answer</b> to a
  * new string describing the supported configuration variables and their
diff --git a/src/app/config/config.h b/src/app/config/config.h
index 12dd6e1ba..a1963b745 100644
--- a/src/app/config/config.h
+++ b/src/app/config/config.h
@@ -182,8 +182,6 @@ char *get_first_listener_addrport_string(int listener_type);
 int options_need_geoip_info(const or_options_t *options,
                             const char **reason_out);
 
-smartlist_t *get_list_of_ports_to_forward(void);
-
 int getinfo_helper_config(control_connection_t *conn,
                           const char *question, char **answer,
                           const char **errmsg);





More information about the tor-commits mailing list