aboutsummaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2006-02-13 06:25:16 +0000
committerRoger Dingledine <arma@torproject.org>2006-02-13 06:25:16 +0000
commit350313d77a1b9dc20abae088ca9db7662dd8a80b (patch)
treeb1722b63b6331fcff7e81fd7e75eb618892e95ec /src/or
parent1181ae61aef77aa505542433c801791b9b13a522 (diff)
downloadtor-350313d77a1b9dc20abae088ca9db7662dd8a80b.tar.gz
tor-350313d77a1b9dc20abae088ca9db7662dd8a80b.zip
Let the users set ControlListenAddress in the torrc.
This can be dangerous, but there are some cases (like a secured LAN) where it makes sense. svn:r5997
Diffstat (limited to 'src/or')
-rw-r--r--src/or/config.c4
-rw-r--r--src/or/connection.c3
-rw-r--r--src/or/or.h2
3 files changed, 8 insertions, 1 deletions
diff --git a/src/or/config.c b/src/or/config.c
index 54fff64181..77836c2a4a 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -137,6 +137,7 @@ static config_var_t _option_vars[] = {
VAR("ClientOnly", BOOL, ClientOnly, "0"),
VAR("ConnLimit", UINT, ConnLimit, "1024"),
VAR("ContactInfo", STRING, ContactInfo, NULL),
+ VAR("ControlListenAddress",LINELIST, ControlListenAddress, NULL),
VAR("ControlPort", UINT, ControlPort, "0"),
VAR("CookieAuthentication",BOOL, CookieAuthentication, "0"),
VAR("DataDirectory", STRING, DataDirectory, NULL),
@@ -1906,6 +1907,9 @@ options_validate(or_options_t *old_options, or_options_t *options,
if (options->DirPort == 0 && options->DirListenAddress != NULL)
REJECT("DirPort must be defined if DirListenAddress is defined.");
+ if (options->ControlPort == 0 && options->ControlListenAddress != NULL)
+ REJECT("ControlPort must be defined if ControlListenAddress is defined.");
+
#if 0 /* don't complain, since a standard configuration does this! */
if (options->SocksPort == 0 && options->SocksListenAddress != NULL)
REJECT("SocksPort must be defined if SocksListenAddress is defined.");
diff --git a/src/or/connection.c b/src/or/connection.c
index 7d50d7e032..fde66b8586 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -973,7 +973,8 @@ retry_all_listeners(int force, smartlist_t *replaced_conns,
options->SocksPort, "127.0.0.1", force,
replaced_conns, new_conns)<0)
return -1;
- if (retry_listeners(CONN_TYPE_CONTROL_LISTENER, NULL,
+ if (retry_listeners(CONN_TYPE_CONTROL_LISTENER,
+ options->ControlListenAddress,
options->ControlPort, "127.0.0.1", force,
replaced_conns, new_conns)<0)
return -1;
diff --git a/src/or/or.h b/src/or/or.h
index b23ac6c4eb..bbed3872fa 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -1240,6 +1240,8 @@ typedef struct {
config_line_t *ORListenAddress;
/** Addresses to bind for listening for directory connections. */
config_line_t *DirListenAddress;
+ /** Addresses to bind for listening for control connections. */
+ config_line_t *ControlListenAddress;
/** Local address to bind outbound sockets */
char *OutboundBindAddress;
/** Directory server only: which versions of