[or-cvs] Let the users set ControlListenAddress in the torrc.
arma at seul.org
arma at seul.org
Mon Feb 13 06:25:18 UTC 2006
Update of /home2/or/cvsroot/tor/src/or
In directory moria:/home/arma/work/onion/cvs/tor/src/or
Modified Files:
config.c connection.c or.h
Log Message:
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.
Index: config.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/config.c,v
retrieving revision 1.508
retrieving revision 1.509
diff -u -p -d -r1.508 -r1.509
--- config.c 13 Feb 2006 01:54:31 -0000 1.508
+++ config.c 13 Feb 2006 06:25:16 -0000 1.509
@@ -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_optio
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.");
Index: connection.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/connection.c,v
retrieving revision 1.441
retrieving revision 1.442
diff -u -p -d -r1.441 -r1.442
--- connection.c 12 Feb 2006 22:27:09 -0000 1.441
+++ connection.c 13 Feb 2006 06:25:16 -0000 1.442
@@ -973,7 +973,8 @@ retry_all_listeners(int force, smartlist
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;
Index: or.h
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/or.h,v
retrieving revision 1.792
retrieving revision 1.793
diff -u -p -d -r1.792 -r1.793
--- or.h 12 Feb 2006 22:28:30 -0000 1.792
+++ or.h 13 Feb 2006 06:25:16 -0000 1.793
@@ -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
More information about the tor-commits
mailing list