aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2002-10-02 01:03:00 +0000
committerRoger Dingledine <arma@torproject.org>2002-10-02 01:03:00 +0000
commitb3b763ad11aca1fe571b8e44507cdc0d4e84b87f (patch)
tree556461ee9361ff121583f8eb7872f54034756266
parent7ed6c8bd39d52b1adf3757aab81326bf77a68538 (diff)
downloadtor-b3b763ad11aca1fe571b8e44507cdc0d4e84b87f.tar
tor-b3b763ad11aca1fe571b8e44507cdc0d4e84b87f.tar.gz
all listeners listen on 0.0.0.0 except AP which listens on 127.0.0.1
svn:r126
-rw-r--r--src/or/connection.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/or/connection.c b/src/or/connection.c
index f8333c0ad..bdb880253 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -279,11 +279,12 @@ int retry_all_connections(int role, uint16_t or_listenport,
return -1;
local.sin_port = htons(or_listenport);
-
if(role & ROLE_OR_CONNECT_ALL) {
router_retry_connections(&local);
}
+ local.sin_addr.s_addr = htonl(INADDR_ANY); /* anyone can connect */
+
if(role & ROLE_OR_LISTEN) {
if(!connection_get_by_type(CONN_TYPE_OR_LISTENER)) {
connection_or_create_listener(&local);
@@ -297,13 +298,6 @@ int retry_all_connections(int role, uint16_t or_listenport,
}
}
- if(role & ROLE_AP_LISTEN) {
- local.sin_port = htons(ap_listenport);
- if(!connection_get_by_type(CONN_TYPE_AP_LISTENER)) {
- connection_ap_create_listener(&local);
- }
- }
-
if(role & ROLE_DIR_LISTEN) {
local.sin_port = htons(dir_listenport);
if(!connection_get_by_type(CONN_TYPE_DIR_LISTENER)) {
@@ -311,6 +305,14 @@ int retry_all_connections(int role, uint16_t or_listenport,
}
}
+ if(role & ROLE_AP_LISTEN) {
+ local.sin_port = htons(ap_listenport);
+ inet_aton("127.0.0.1", &(local.sin_addr)); /* the AP listens only on localhost! */
+ if(!connection_get_by_type(CONN_TYPE_AP_LISTENER)) {
+ connection_ap_create_listener(&local);
+ }
+ }
+
return 0;
}