Forráskód Böngészése

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 16 éve
szülő
commit
15b2b8bd69
7 módosított fájl, 10 hozzáadás és 78 törlés
  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,
       don't reschedule publication of the next descriptor. Fixes bug 763.
       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):
     - 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
 .LP
 .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
 Advertise this port to listen for connections from Socks-speaking
 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.
 .LP
 .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
 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

+ 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);
     case CIRCUIT_PURPOSE_C_ESTABLISH_REND:
       return router_choose_random_node(
-               options->RendNodes, options->RendExcludeNodes, NULL,
+               NULL, NULL, NULL,
                options->ExcludeNodes, need_uptime, need_capacity, 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->timestamp_dirty) {
       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) &&
           (!need_capacity || circ->build_state->need_capacity) &&
           (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(HidServDirectoryV2,          BOOL,     "0"),
   VAR("HiddenServiceDir",    LINELIST_S, RendConfigLines,    NULL),
-  VAR("HiddenServiceExcludeNodes", LINELIST_S, RendConfigLines, NULL),
-  VAR("HiddenServiceNodes",  LINELIST_S, RendConfigLines,    NULL),
+  OBSOLETE("HiddenServiceExcludeNodes"),
+  OBSOLETE("HiddenServiceNodes"),
   VAR("HiddenServiceOptions",LINELIST_V, RendConfigLines,    NULL),
   VAR("HiddenServicePort",   LINELIST_S, RendConfigLines,    NULL),
   VAR("HiddenServiceVersion",LINELIST_S, RendConfigLines,    NULL),
@@ -275,8 +275,8 @@ static config_var_t _option_vars[] = {
   V(RejectPlaintextPorts,        CSV,      ""),
   V(RelayBandwidthBurst,         MEMUNIT,  "0"),
   V(RelayBandwidthRate,          MEMUNIT,  "0"),
-  V(RendExcludeNodes,            STRING,   NULL),
-  V(RendNodes,                   STRING,   NULL),
+  OBSOLETE("RendExcludeNodes"),
+  OBSOLETE("RendNodes"),
   V(RendPostPeriod,              INTERVAL, "1 hour"),
   V(RephistTrackTime,            INTERVAL, "24 hours"),
   OBSOLETE("RouterFile"),
@@ -496,9 +496,6 @@ static config_var_description_t options_description[] = {
   { "ReachableAddresses", "Addresses we can connect to, as IP/bits:port-port. "
     "By default, we assume all addresses are reachable." },
   /* 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 */
   { "SOCKSPort", "The port where we listen for SOCKS connections from "
     "applications." },
@@ -3314,10 +3311,6 @@ options_validate(or_options_t *old_options, or_options_t *options,
     return -1;
   if (check_nickname_list(options->EntryNodes, "EntryNodes", msg))
     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))
     return -1;
   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 */
   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". */
   smartlist_t *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 */
   char *directory; /**< where in the filesystem it stores it */
   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
                            * published. */
   /* Other fields */
@@ -97,8 +95,6 @@ rend_service_free(rend_service_t *service)
       rend_intro_point_free(intro););
     smartlist_free(service->intro_nodes);
   }
-  tor_free(service->intro_prefer_nodes);
-  tor_free(service->intro_exclude_nodes);
   if (service->desc)
     rend_service_descriptor_free(service->desc);
   tor_free(service);
@@ -127,10 +123,6 @@ rend_add_service(rend_service_t *service)
   rend_service_port_config_t *p;
   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();
 
   /* 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));
       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->descriptor_version = 0; /* Unversioned descriptor. */
     rend_add_service(v0_service);
@@ -285,24 +275,6 @@ rend_config_services(or_options_t *options, int validate_only)
         return -1;
       }
       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 {
       smartlist_t *versions;
       char *version_str;
@@ -1303,8 +1275,7 @@ rend_services_introduce(void)
     smartlist_add_all(exclude_routers, intro_routers);
     /* The directory is now here. Pick three ORs as intro points. */
     for (j=prev_intro_nodes; j < NUM_INTRO_POINTS; ++j) {
-      router = router_choose_random_node(service->intro_prefer_nodes,
-               service->intro_exclude_nodes, exclude_routers,
+      router = router_choose_random_node(NULL, NULL, exclude_routers,
                options->ExcludeNodes, 1, 0, 0,
                get_options()->_AllowInvalid & ALLOW_INVALID_INTRODUCTION,
                0, 0);