diff options
author | George Kadianakis <desnacked@riseup.net> | 2012-03-31 14:04:58 +0200 |
---|---|---|
committer | George Kadianakis <desnacked@riseup.net> | 2012-03-31 14:04:58 +0200 |
commit | 10232dc0423792a8fb61b9ec136d7ffd5484216b (patch) | |
tree | 76e2b7b2696a11b1ce02eec2cad64eab90e0b061 /src/or/transports.c | |
parent | fedf76a2e6452124c38ecc51cea6567b9d5cc23d (diff) | |
download | tor-10232dc0423792a8fb61b9ec136d7ffd5484216b.tar.gz tor-10232dc0423792a8fb61b9ec136d7ffd5484216b.zip |
Pass OR address to PT proxy, even with IPv6 or ORListenAddress.
Introduce get_first_listener_addrport_for_pt() which returns a string
containing the addrport of the first listener we could find. Use it to
form the TOR_PT_ORPORT managed proxy protocol line.
Diffstat (limited to 'src/or/transports.c')
-rw-r--r-- | src/or/transports.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/or/transports.c b/src/or/transports.c index 564603e1fe..1f2149381e 100644 --- a/src/or/transports.c +++ b/src/or/transports.c @@ -957,8 +957,6 @@ get_bindaddr_for_server_proxy(const managed_proxy_t *mp) static process_environment_t * create_managed_proxy_environment(const managed_proxy_t *mp) { - const or_options_t *options = get_options(); - /* Environment variables to be added to or set in mp's environment. */ smartlist_t *envs = smartlist_new(); /* XXXX The next time someone touches this code, shorten the name of @@ -993,8 +991,11 @@ create_managed_proxy_environment(const managed_proxy_t *mp) } if (mp->is_server) { - smartlist_add_asprintf(envs, "TOR_PT_ORPORT=127.0.0.1:%s", - options->ORPort->value); + { + char *orport_tmp = get_first_listener_addrport_for_pt(CONN_TYPE_OR_LISTENER); + smartlist_add_asprintf(envs, "TOR_PT_ORPORT=%s", orport_tmp); + tor_free(orport_tmp); + } { char *bindaddr_tmp = get_bindaddr_for_server_proxy(mp); |