]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Merge remote-tracking branch 'public/ticket20001_v2'
authorNick Mathewson <nickm@torproject.org>
Mon, 26 Sep 2016 18:01:10 +0000 (11:01 -0700)
committerNick Mathewson <nickm@torproject.org>
Mon, 26 Sep 2016 18:01:10 +0000 (11:01 -0700)
1  2 
src/or/routerparse.c
src/test/test_dir.c

index d5690c11018401347ff8ddefb4e9886b4fb1a430,b1d9a85e1dee25581cfb22a6a3bed8b1cc0016d9..db3d004f2619f7cdd4e3002fb547ea154fb897a3
@@@ -2904,23 -2876,20 +2905,29 @@@ routerstatus_parse_entry_from_string(me
          rs->is_v2_dir = 1;
        }
      }
+     /* These are implied true by having been included in a consensus made
+      * with a given method */
+     rs->is_flagged_running = 1; /* Starting with consensus method 4. */
+     if (consensus_method >= MIN_METHOD_FOR_EXCLUDING_INVALID_NODES)
+       rs->is_valid = 1;
    }
 +  int found_protocol_list = 0;
 +  if ((tok = find_opt_by_keyword(tokens, K_PROTO))) {
 +    found_protocol_list = 1;
 +    rs->protocols_known = 1;
 +    rs->supports_extend2_cells =
 +      protocol_list_supports_protocol(tok->args[0], PRT_RELAY, 2);
 +  }
    if ((tok = find_opt_by_keyword(tokens, K_V))) {
      tor_assert(tok->n_args == 1);
 -    rs->version_known = 1;
 -    if (strcmpstart(tok->args[0], "Tor ")) {
 -    } else {
 -      rs->version_supports_extend2_cells =
 +    if (!strcmpstart(tok->args[0], "Tor ") && !found_protocol_list) {
 +      /* We only do version checks like this in the case where
 +       * the version is a "Tor" version, and where there is no
 +       * list of protocol versions that we should be looking at instead. */
 +      rs->supports_extend2_cells =
          tor_version_as_new_as(tok->args[0], "0.2.4.8-alpha");
 +      rs->protocols_known = 1;
      }
      if (vote_rs) {
        vote_rs->version = tor_strdup(tok->args[0]);
Simple merge