Ticket #754: rendnodes_bugfix.diff

File rendnodes_bugfix.diff, 10.7 KB (added by chrisw, 11 years ago)

Bugfix on Task #754

  • home/chris/workspace/tor-0_2_1_2_alpha_3/ChangeLog

     
    2727      that was not included in the last published rendezvous descriptor,
    2828      don't reschedule publication of the next descriptor. Fixes bug 763.
    2929      Bugfix on 0.0.9.3.
     30    - Mark RendNodes, RendExcludeNodes, HiddenServiceNodes, and
     31      HiddenServiceExcludeNodes as obsolete. Fixes bug 754. Bugfix on
     32      0.1.0.1-rc.
    3033
    3134
    3235Changes in version 0.2.0.29-rc - 2008-07-08
  • home/chris/workspace/tor-0_2_1_2_alpha_3/doc/tor.1.in

     
    542542.\" .TP
    543543.LP
    544544.TP
    545 \fBRendNodes \fR\fInode\fR,\fInode\fR,\fI...\fP
    546 A list of identity fingerprints or nicknames of preferred nodes to use for the
    547 rendezvous point, if possible.
    548 .LP
    549 .TP
    550 \fBRendExcludeNodes \fR\fInode\fR,\fInode\fR,\fI...\fP
    551 A list of identity fingerprints or nicknames of nodes to never use when
    552 choosing a rendezvous point.
    553 .LP
    554 .TP
    555545\fBSocksPort \fR\fIPORT\fP
    556546Advertise this port to listen for connections from Socks-speaking
    557547applications.  Set this to 0 if you don't want to allow application
     
    12641254one of the TARGETs from those lines will be chosen at random.
    12651255.LP
    12661256.TP
    1267 \fBHiddenServiceNodes \fR\fInode\fR,\fInode\fR,\fI...\fP
    1268 If possible, use the specified nodes, defined by their identity fingerprints or
    1269 nicknames, as introduction points for the hidden service. If this is left
    1270 unset, Tor will be smart and pick some reasonable ones; most people can leave
    1271 this unset.
    1272 .LP
    1273 .TP
    1274 \fBHiddenServiceExcludeNodes \fR\fInode\fR,\fInode\fR,\fI...\fP
    1275 Do not use the specified nodes, defined by their identity fingerprints or
    1276 nicknames, as introduction points for the hidden service. In normal use there
    1277 is no reason to set this.
    1278 .LP
    1279 .TP
    12801257\fBPublishHidServDescriptors \fR\fB0\fR|\fB1\fR\fP
    12811258If set to 0, Tor will run any hidden services you configure, but it won't
    12821259advertise them to the rendezvous directory. This option is only useful
  • home/chris/workspace/tor-0_2_1_2_alpha_3/src/or/circuitbuild.c

     
    13761376      else
    13771377        return choose_good_exit_server_general(dir,need_uptime,need_capacity);
    13781378    case CIRCUIT_PURPOSE_C_ESTABLISH_REND:
    1379       return router_choose_random_node(
    1380                options->RendNodes, options->RendExcludeNodes,
    1381                NULL, need_uptime, need_capacity, 0,
    1382                options->_AllowInvalid & ALLOW_INVALID_RENDEZVOUS, 0, 0);
     1379      return router_choose_random_node(NULL, NULL, NULL, need_uptime,
     1380                   need_capacity, 0,
     1381                   options->_AllowInvalid & ALLOW_INVALID_RENDEZVOUS, 0, 0);
    13831382  }
    13841383  log_warn(LD_BUG,"Unhandled purpose %d", purpose);
    13851384  tor_fragile_assert();
  • home/chris/workspace/tor-0_2_1_2_alpha_3/src/or/circuitlist.c

     
    830830        _circ->purpose == CIRCUIT_PURPOSE_C_GENERAL &&
    831831        !_circ->timestamp_dirty) {
    832832      origin_circuit_t *circ = TO_ORIGIN_CIRCUIT(_circ);
    833 #if 0 /* XXX here while roger investigates a reported RendNodes bug */
    834       if (_circ->purpose == CIRCUIT_PURPOSE_C_ESTABLISH_REND &&
    835           options->RendNodes) {
    836         routerinfo_t *exit = build_state_get_exit_router(circ->build_state);
    837         if (exit && !router_nickname_is_in_list(exit, options->RendNodes))
    838           continue; /* not one of our allowed RendNodes */
    839       }
    840 #endif
    841833      if ((!need_uptime || circ->build_state->need_uptime) &&
    842834          (!need_capacity || circ->build_state->need_capacity) &&
    843835          (internal == circ->build_state->is_internal)) {
  • home/chris/workspace/tor-0_2_1_2_alpha_3/src/or/config.c

     
    218218  V(HashedControlPassword,       LINELIST, NULL),
    219219  V(HidServDirectoryV2,          BOOL,     "0"),
    220220  VAR("HiddenServiceDir",    LINELIST_S, RendConfigLines,    NULL),
    221   VAR("HiddenServiceExcludeNodes", LINELIST_S, RendConfigLines, NULL),
    222   VAR("HiddenServiceNodes",  LINELIST_S, RendConfigLines,    NULL),
     221  OBSOLETE("HiddenServiceExcludeNodes"),
     222  OBSOLETE("HiddenServiceNodes"),
    223223  VAR("HiddenServiceOptions",LINELIST_V, RendConfigLines,    NULL),
    224224  VAR("HiddenServicePort",   LINELIST_S, RendConfigLines,    NULL),
    225225  VAR("HiddenServiceVersion",LINELIST_S, RendConfigLines,    NULL),
     
    272272  V(RejectPlaintextPorts,        CSV,      ""),
    273273  V(RelayBandwidthBurst,         MEMUNIT,  "0"),
    274274  V(RelayBandwidthRate,          MEMUNIT,  "0"),
    275   V(RendExcludeNodes,            STRING,   NULL),
    276   V(RendNodes,                   STRING,   NULL),
     275  OBSOLETE("RendExcludeNodes"),
     276  OBSOLETE("RendNodes"),
    277277  V(RendPostPeriod,              INTERVAL, "1 hour"),
    278278  V(RephistTrackTime,            INTERVAL, "24 hours"),
    279279  OBSOLETE("RouterFile"),
     
    493493  { "ReachableAddresses", "Addresses we can connect to, as IP/bits:port-port. "
    494494    "By default, we assume all addresses are reachable." },
    495495  /* reachablediraddresses, reachableoraddresses. */
    496   { "RendNodes", "A list of preferred nodes to use for a rendezvous point, "
    497     "when possible." },
    498   { "RendExcludenodes", "A list of nodes never to use as rendezvous points." },
    499496  /* SafeSOCKS */
    500497  { "SOCKSPort", "The port where we listen for SOCKS connections from "
    501498    "applications." },
     
    32863283    return -1;
    32873284  if (check_nickname_list(options->ExcludeNodes, "ExcludeNodes", msg))
    32883285    return -1;
    3289   if (check_nickname_list(options->RendNodes, "RendNodes", msg))
    3290     return -1;
    3291   if (check_nickname_list(options->RendNodes, "RendExcludeNodes", msg))
    3292     return -1;
    32933286  if (check_nickname_list(options->TestVia, "TestVia", msg))
    32943287    return -1;
    32953288  if (check_nickname_list(options->MyFamily, "MyFamily", msg))
  • home/chris/workspace/tor-0_2_1_2_alpha_3/src/or/or.h

     
    20292029  char *ExcludeNodes; /**< Comma-separated list of nicknames of ORs not to
    20302030                       * use in circuits. */
    20312031
    2032   char *RendNodes; /**< Comma-separated list of nicknames used as introduction
    2033                     * points. */
    2034   char *RendExcludeNodes; /**< Comma-separated list of nicknames not to use
    2035                            * as introduction points. */
    2036 
    20372032  /** List of "entry", "middle", "exit", "introduction", "rendezvous". */
    20382033  smartlist_t *AllowInvalidNodes;
    20392034  int _AllowInvalid; /**< Bitmask; derived from AllowInvalidNodes. */
  • home/chris/workspace/tor-0_2_1_2_alpha_3/src/or/rendservice.c

     
    4545  /* Fields specified in config file */
    4646  char *directory; /**< where in the filesystem it stores it */
    4747  smartlist_t *ports; /**< List of rend_service_port_config_t */
    48   char *intro_prefer_nodes; /**< comma-separated list of nicknames */
    49   char *intro_exclude_nodes; /**< comma-separated list of nicknames */
    5048  int descriptor_version; /**< Rendezvous descriptor version that will be
    5149                           * published. */
    5250  /* Other fields */
     
    9795      rend_intro_point_free(intro););
    9896    smartlist_free(service->intro_nodes);
    9997  }
    100   tor_free(service->intro_prefer_nodes);
    101   tor_free(service->intro_exclude_nodes);
    10298  if (service->desc)
    10399    rend_service_descriptor_free(service->desc);
    104100  tor_free(service);
     
    127123  rend_service_port_config_t *p;
    128124  struct in_addr addr;
    129125
    130   if (!service->intro_prefer_nodes)
    131     service->intro_prefer_nodes = tor_strdup("");
    132   if (!service->intro_exclude_nodes)
    133     service->intro_exclude_nodes = tor_strdup("");
    134126  service->intro_nodes = smartlist_create();
    135127
    136128  /* If the service is configured to publish unversioned (v0) and versioned
     
    145137      memcpy(copy, p, sizeof(rend_service_port_config_t));
    146138      smartlist_add(v0_service->ports, copy);
    147139    });
    148     v0_service->intro_prefer_nodes = tor_strdup(service->intro_prefer_nodes);
    149     v0_service->intro_exclude_nodes = tor_strdup(service->intro_exclude_nodes);
    150140    v0_service->intro_period_started = service->intro_period_started;
    151141    v0_service->descriptor_version = 0; /* Unversioned descriptor. */
    152142    rend_add_service(v0_service);
     
    285275        return -1;
    286276      }
    287277      smartlist_add(service->ports, portcfg);
    288     } else if (!strcasecmp(line->key, "HiddenServiceNodes")) {
    289       if (service->intro_prefer_nodes) {
    290         log_warn(LD_CONFIG,
    291                  "Got multiple HiddenServiceNodes lines for a single "
    292                  "service.");
    293         rend_service_free(service);
    294         return -1;
    295       }
    296       service->intro_prefer_nodes = tor_strdup(line->value);
    297     } else if (!strcasecmp(line->key, "HiddenServiceExcludeNodes")) {
    298       if (service->intro_exclude_nodes) {
    299         log_warn(LD_CONFIG,
    300                  "Got multiple HiddenServiceExcludedNodes lines for "
    301                  "a single service.");
    302         rend_service_free(service);
    303         return -1;
    304       }
    305       service->intro_exclude_nodes = tor_strdup(line->value);
    306278    } else {
    307279      smartlist_t *versions;
    308280      char *version_str;
     
    13021274    smartlist_add_all(exclude_routers, intro_routers);
    13031275    /* The directory is now here. Pick three ORs as intro points. */
    13041276    for (j=prev_intro_nodes; j < NUM_INTRO_POINTS; ++j) {
    1305       router = router_choose_random_node(service->intro_prefer_nodes,
    1306                service->intro_exclude_nodes, exclude_routers, 1, 0, 0,
     1277      router = router_choose_random_node(NULL, NULL, exclude_routers, 1, 0, 0,
    13071278               get_options()->_AllowInvalid & ALLOW_INVALID_INTRODUCTION,
    13081279               0, 0);
    13091280      if (!router) {