浏览代码

r17309@aud-055: nickm | 2008-07-23 16:05:43 +0200
Patch from Christian Wilms: remove (HiddenService|Rend)(Exclude)?Nodes options. They never worked properly, and nobody seems to be using them. Resolves bug 754.


svn:r16144

Nick Mathewson 17 年之前
父节点
当前提交
15b2b8bd69
共有 7 个文件被更改,包括 10 次插入78 次删除
  1. 4 0
      ChangeLog
  2. 0 23
      doc/tor.1.in
  3. 1 1
      src/or/circuitbuild.c
  4. 0 8
      src/or/circuitlist.c
  5. 4 11
      src/or/config.c
  6. 0 5
      src/or/or.h
  7. 1 30
      src/or/rendservice.c

+ 4 - 0
ChangeLog

@@ -38,6 +38,10 @@ Changes in version 0.2.1.3-alpha - 2008-07-xx
       that was not included in the last published rendezvous descriptor,
       that was not included in the last published rendezvous descriptor,
       don't reschedule publication of the next descriptor. Fixes bug 763.
       don't reschedule publication of the next descriptor. Fixes bug 763.
       Bugfix on 0.0.9.3.
       Bugfix on 0.0.9.3.
+    - Mark RendNodes, RendExcludeNodes, HiddenServiceNodes, and
+      HiddenServiceExcludeNodes as obsolete: they never worked properly,
+      and nobody claims to be using them. Fixes bug 754. Bugfix on
+      0.1.0.1-rc.  Patch from Christian Wilms.
 
 
   o Minor bugfixes (controller):
   o Minor bugfixes (controller):
     - When closing an application-side connection because its circuit
     - When closing an application-side connection because its circuit

+ 0 - 23
doc/tor.1.in

@@ -550,16 +550,6 @@ close" on the same circuit.  Currently, two addresses are
 .\" .TP
 .\" .TP
 .LP
 .LP
 .TP
 .TP
-\fBRendNodes \fR\fInode\fR,\fInode\fR,\fI...\fP
-A list of identity fingerprints or nicknames of preferred nodes to use for the
-rendezvous point, if possible.
-.LP
-.TP
-\fBRendExcludeNodes \fR\fInode\fR,\fInode\fR,\fI...\fP
-A list of identity fingerprints or nicknames of nodes to never use when
-choosing a rendezvous point.
-.LP
-.TP
 \fBSocksPort \fR\fIPORT\fP
 \fBSocksPort \fR\fIPORT\fP
 Advertise this port to listen for connections from Socks-speaking
 Advertise this port to listen for connections from Socks-speaking
 applications.  Set this to 0 if you don't want to allow application
 applications.  Set this to 0 if you don't want to allow application
@@ -1272,19 +1262,6 @@ multiple lines with the same VIRTPORT: when a user connects to that VIRTPORT,
 one of the TARGETs from those lines will be chosen at random.
 one of the TARGETs from those lines will be chosen at random.
 .LP
 .LP
 .TP
 .TP
-\fBHiddenServiceNodes \fR\fInode\fR,\fInode\fR,\fI...\fP
-If possible, use the specified nodes, defined by their identity fingerprints or
-nicknames, as introduction points for the hidden service. If this is left
-unset, Tor will be smart and pick some reasonable ones; most people can leave
-this unset.
-.LP
-.TP
-\fBHiddenServiceExcludeNodes \fR\fInode\fR,\fInode\fR,\fI...\fP
-Do not use the specified nodes, defined by their identity fingerprints or
-nicknames, as introduction points for the hidden service. In normal use there
-is no reason to set this.
-.LP
-.TP
 \fBPublishHidServDescriptors \fR\fB0\fR|\fB1\fR\fP
 \fBPublishHidServDescriptors \fR\fB0\fR|\fB1\fR\fP
 If set to 0, Tor will run any hidden services you configure, but it won't
 If set to 0, Tor will run any hidden services you configure, but it won't
 advertise them to the rendezvous directory. This option is only useful
 advertise them to the rendezvous directory. This option is only useful

+ 1 - 1
src/or/circuitbuild.c

@@ -1365,7 +1365,7 @@ choose_good_exit_server(uint8_t purpose, routerlist_t *dir,
         return choose_good_exit_server_general(dir,need_uptime,need_capacity);
         return choose_good_exit_server_general(dir,need_uptime,need_capacity);
     case CIRCUIT_PURPOSE_C_ESTABLISH_REND:
     case CIRCUIT_PURPOSE_C_ESTABLISH_REND:
       return router_choose_random_node(
       return router_choose_random_node(
-               options->RendNodes, options->RendExcludeNodes, NULL,
+               NULL, NULL, NULL,
                options->ExcludeNodes, need_uptime, need_capacity, 0,
                options->ExcludeNodes, need_uptime, need_capacity, 0,
                options->_AllowInvalid & ALLOW_INVALID_RENDEZVOUS, 0, 0);
                options->_AllowInvalid & ALLOW_INVALID_RENDEZVOUS, 0, 0);
   }
   }

+ 0 - 8
src/or/circuitlist.c

@@ -838,14 +838,6 @@ circuit_find_to_cannibalize(uint8_t purpose, extend_info_t *info,
         _circ->purpose == CIRCUIT_PURPOSE_C_GENERAL &&
         _circ->purpose == CIRCUIT_PURPOSE_C_GENERAL &&
         !_circ->timestamp_dirty) {
         !_circ->timestamp_dirty) {
       origin_circuit_t *circ = TO_ORIGIN_CIRCUIT(_circ);
       origin_circuit_t *circ = TO_ORIGIN_CIRCUIT(_circ);
-#if 0 /* XXX here while roger investigates a reported RendNodes bug */
-      if (_circ->purpose == CIRCUIT_PURPOSE_C_ESTABLISH_REND &&
-          options->RendNodes) {
-        routerinfo_t *exit = build_state_get_exit_router(circ->build_state);
-        if (exit && !router_nickname_is_in_list(exit, options->RendNodes))
-          continue; /* not one of our allowed RendNodes */
-      }
-#endif
       if ((!need_uptime || circ->build_state->need_uptime) &&
       if ((!need_uptime || circ->build_state->need_uptime) &&
           (!need_capacity || circ->build_state->need_capacity) &&
           (!need_capacity || circ->build_state->need_capacity) &&
           (internal == circ->build_state->is_internal)) {
           (internal == circ->build_state->is_internal)) {

+ 4 - 11
src/or/config.c

@@ -221,8 +221,8 @@ static config_var_t _option_vars[] = {
   V(HashedControlPassword,       LINELIST, NULL),
   V(HashedControlPassword,       LINELIST, NULL),
   V(HidServDirectoryV2,          BOOL,     "0"),
   V(HidServDirectoryV2,          BOOL,     "0"),
   VAR("HiddenServiceDir",    LINELIST_S, RendConfigLines,    NULL),
   VAR("HiddenServiceDir",    LINELIST_S, RendConfigLines,    NULL),
-  VAR("HiddenServiceExcludeNodes", LINELIST_S, RendConfigLines, NULL),
+  OBSOLETE("HiddenServiceExcludeNodes"),
-  VAR("HiddenServiceNodes",  LINELIST_S, RendConfigLines,    NULL),
+  OBSOLETE("HiddenServiceNodes"),
   VAR("HiddenServiceOptions",LINELIST_V, RendConfigLines,    NULL),
   VAR("HiddenServiceOptions",LINELIST_V, RendConfigLines,    NULL),
   VAR("HiddenServicePort",   LINELIST_S, RendConfigLines,    NULL),
   VAR("HiddenServicePort",   LINELIST_S, RendConfigLines,    NULL),
   VAR("HiddenServiceVersion",LINELIST_S, RendConfigLines,    NULL),
   VAR("HiddenServiceVersion",LINELIST_S, RendConfigLines,    NULL),
@@ -275,8 +275,8 @@ static config_var_t _option_vars[] = {
   V(RejectPlaintextPorts,        CSV,      ""),
   V(RejectPlaintextPorts,        CSV,      ""),
   V(RelayBandwidthBurst,         MEMUNIT,  "0"),
   V(RelayBandwidthBurst,         MEMUNIT,  "0"),
   V(RelayBandwidthRate,          MEMUNIT,  "0"),
   V(RelayBandwidthRate,          MEMUNIT,  "0"),
-  V(RendExcludeNodes,            STRING,   NULL),
+  OBSOLETE("RendExcludeNodes"),
-  V(RendNodes,                   STRING,   NULL),
+  OBSOLETE("RendNodes"),
   V(RendPostPeriod,              INTERVAL, "1 hour"),
   V(RendPostPeriod,              INTERVAL, "1 hour"),
   V(RephistTrackTime,            INTERVAL, "24 hours"),
   V(RephistTrackTime,            INTERVAL, "24 hours"),
   OBSOLETE("RouterFile"),
   OBSOLETE("RouterFile"),
@@ -496,9 +496,6 @@ static config_var_description_t options_description[] = {
   { "ReachableAddresses", "Addresses we can connect to, as IP/bits:port-port. "
   { "ReachableAddresses", "Addresses we can connect to, as IP/bits:port-port. "
     "By default, we assume all addresses are reachable." },
     "By default, we assume all addresses are reachable." },
   /* reachablediraddresses, reachableoraddresses. */
   /* reachablediraddresses, reachableoraddresses. */
-  { "RendNodes", "A list of preferred nodes to use for a rendezvous point, "
-    "when possible." },
-  { "RendExcludenodes", "A list of nodes never to use as rendezvous points." },
   /* SafeSOCKS */
   /* SafeSOCKS */
   { "SOCKSPort", "The port where we listen for SOCKS connections from "
   { "SOCKSPort", "The port where we listen for SOCKS connections from "
     "applications." },
     "applications." },
@@ -3314,10 +3311,6 @@ options_validate(or_options_t *old_options, or_options_t *options,
     return -1;
     return -1;
   if (check_nickname_list(options->EntryNodes, "EntryNodes", msg))
   if (check_nickname_list(options->EntryNodes, "EntryNodes", msg))
     return -1;
     return -1;
-  if (check_nickname_list(options->RendNodes, "RendNodes", msg))
-    return -1;
-  if (check_nickname_list(options->RendNodes, "RendExcludeNodes", msg))
-    return -1;
   if (check_nickname_list(options->TestVia, "TestVia", msg))
   if (check_nickname_list(options->TestVia, "TestVia", msg))
     return -1;
     return -1;
   if (check_nickname_list(options->MyFamily, "MyFamily", msg))
   if (check_nickname_list(options->MyFamily, "MyFamily", msg))

+ 0 - 5
src/or/or.h

@@ -2035,11 +2035,6 @@ typedef struct {
   /** Union of ExcludeNodes and ExcludeExitNodes */
   /** Union of ExcludeNodes and ExcludeExitNodes */
   struct routerset_t *_ExcludeExitNodesUnion;
   struct routerset_t *_ExcludeExitNodesUnion;
 
 
-  char *RendNodes; /**< Comma-separated list of nicknames used as introduction
-                    * points. */
-  char *RendExcludeNodes; /**< Comma-separated list of nicknames not to use
-                           * as introduction points. */
-
   /** List of "entry", "middle", "exit", "introduction", "rendezvous". */
   /** List of "entry", "middle", "exit", "introduction", "rendezvous". */
   smartlist_t *AllowInvalidNodes;
   smartlist_t *AllowInvalidNodes;
   int _AllowInvalid; /**< Bitmask; derived from AllowInvalidNodes. */
   int _AllowInvalid; /**< Bitmask; derived from AllowInvalidNodes. */

+ 1 - 30
src/or/rendservice.c

@@ -45,8 +45,6 @@ typedef struct rend_service_t {
   /* Fields specified in config file */
   /* Fields specified in config file */
   char *directory; /**< where in the filesystem it stores it */
   char *directory; /**< where in the filesystem it stores it */
   smartlist_t *ports; /**< List of rend_service_port_config_t */
   smartlist_t *ports; /**< List of rend_service_port_config_t */
-  char *intro_prefer_nodes; /**< comma-separated list of nicknames */
-  char *intro_exclude_nodes; /**< comma-separated list of nicknames */
   int descriptor_version; /**< Rendezvous descriptor version that will be
   int descriptor_version; /**< Rendezvous descriptor version that will be
                            * published. */
                            * published. */
   /* Other fields */
   /* Other fields */
@@ -97,8 +95,6 @@ rend_service_free(rend_service_t *service)
       rend_intro_point_free(intro););
       rend_intro_point_free(intro););
     smartlist_free(service->intro_nodes);
     smartlist_free(service->intro_nodes);
   }
   }
-  tor_free(service->intro_prefer_nodes);
-  tor_free(service->intro_exclude_nodes);
   if (service->desc)
   if (service->desc)
     rend_service_descriptor_free(service->desc);
     rend_service_descriptor_free(service->desc);
   tor_free(service);
   tor_free(service);
@@ -127,10 +123,6 @@ rend_add_service(rend_service_t *service)
   rend_service_port_config_t *p;
   rend_service_port_config_t *p;
   struct in_addr addr;
   struct in_addr addr;
 
 
-  if (!service->intro_prefer_nodes)
-    service->intro_prefer_nodes = tor_strdup("");
-  if (!service->intro_exclude_nodes)
-    service->intro_exclude_nodes = tor_strdup("");
   service->intro_nodes = smartlist_create();
   service->intro_nodes = smartlist_create();
 
 
   /* If the service is configured to publish unversioned (v0) and versioned
   /* If the service is configured to publish unversioned (v0) and versioned
@@ -145,8 +137,6 @@ rend_add_service(rend_service_t *service)
       memcpy(copy, p, sizeof(rend_service_port_config_t));
       memcpy(copy, p, sizeof(rend_service_port_config_t));
       smartlist_add(v0_service->ports, copy);
       smartlist_add(v0_service->ports, copy);
     });
     });
-    v0_service->intro_prefer_nodes = tor_strdup(service->intro_prefer_nodes);
-    v0_service->intro_exclude_nodes = tor_strdup(service->intro_exclude_nodes);
     v0_service->intro_period_started = service->intro_period_started;
     v0_service->intro_period_started = service->intro_period_started;
     v0_service->descriptor_version = 0; /* Unversioned descriptor. */
     v0_service->descriptor_version = 0; /* Unversioned descriptor. */
     rend_add_service(v0_service);
     rend_add_service(v0_service);
@@ -285,24 +275,6 @@ rend_config_services(or_options_t *options, int validate_only)
         return -1;
         return -1;
       }
       }
       smartlist_add(service->ports, portcfg);
       smartlist_add(service->ports, portcfg);
-    } else if (!strcasecmp(line->key, "HiddenServiceNodes")) {
-      if (service->intro_prefer_nodes) {
-        log_warn(LD_CONFIG,
-                 "Got multiple HiddenServiceNodes lines for a single "
-                 "service.");
-        rend_service_free(service);
-        return -1;
-      }
-      service->intro_prefer_nodes = tor_strdup(line->value);
-    } else if (!strcasecmp(line->key, "HiddenServiceExcludeNodes")) {
-      if (service->intro_exclude_nodes) {
-        log_warn(LD_CONFIG,
-                 "Got multiple HiddenServiceExcludedNodes lines for "
-                 "a single service.");
-        rend_service_free(service);
-        return -1;
-      }
-      service->intro_exclude_nodes = tor_strdup(line->value);
     } else {
     } else {
       smartlist_t *versions;
       smartlist_t *versions;
       char *version_str;
       char *version_str;
@@ -1303,8 +1275,7 @@ rend_services_introduce(void)
     smartlist_add_all(exclude_routers, intro_routers);
     smartlist_add_all(exclude_routers, intro_routers);
     /* The directory is now here. Pick three ORs as intro points. */
     /* The directory is now here. Pick three ORs as intro points. */
     for (j=prev_intro_nodes; j < NUM_INTRO_POINTS; ++j) {
     for (j=prev_intro_nodes; j < NUM_INTRO_POINTS; ++j) {
-      router = router_choose_random_node(service->intro_prefer_nodes,
+      router = router_choose_random_node(NULL, NULL, exclude_routers,
-               service->intro_exclude_nodes, exclude_routers,
                options->ExcludeNodes, 1, 0, 0,
                options->ExcludeNodes, 1, 0, 0,
                get_options()->_AllowInvalid & ALLOW_INVALID_INTRODUCTION,
                get_options()->_AllowInvalid & ALLOW_INVALID_INTRODUCTION,
                0, 0);
                0, 0);