summaryrefslogtreecommitdiff
path: root/src/or/config.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2008-02-04 16:58:50 +0000
committerRoger Dingledine <arma@torproject.org>2008-02-04 16:58:50 +0000
commit426a9bbde18046ad021fbfc5b38383ce18d5c798 (patch)
treea13849678c87892dd5a3060d913e2571d4eb3fe9 /src/or/config.c
parentdad9f434e0573b417f1029d53c89984b764d4689 (diff)
downloadtor-426a9bbde18046ad021fbfc5b38383ce18d5c798.tar.gz
tor-426a9bbde18046ad021fbfc5b38383ce18d5c798.zip
Don't trigger an assert if we start a directory authority with a
private IP address (like 127.0.0.1). svn:r13371
Diffstat (limited to 'src/or/config.c')
-rw-r--r--src/or/config.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/or/config.c b/src/or/config.c
index b0eeec6376..6a771909e5 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -2872,7 +2872,7 @@ options_validate(or_options_t *old_options, or_options_t *options,
options->V1AuthoritativeDir || options->V2AuthoritativeDir ||
options->V3AuthoritativeDir))
REJECT("AuthoritativeDir is set, but none of "
- "(Bridge/HS/V1/V2/V3)AuthoriativeDir is set.");
+ "(Bridge/HS/V1/V2/V3)AuthoritativeDir is set.");
}
if (options->AuthoritativeDir && !options->DirPort)
@@ -3974,12 +3974,12 @@ parse_bridge_line(const char *line, int validate_only)
return r;
}
-/** Read the contents of a DirServer line from <b>line</b>. Return 0
- * if the line is well-formed, and -1 if it isn't. If
+/** Read the contents of a DirServer line from <b>line</b>. If
* <b>validate_only</b> is 0, and the line is well-formed, and it
* shares any bits with <b>required_type</b> or <b>required_type</b>
* is 0, then add the dirserver described in the line (minus whatever
- * bits it's missing) as a valid authority. */
+ * bits it's missing) as a valid authority. Return 0 on success,
+ * or -1 if the line isn't well-formed or if we can't add it. */
static int
parse_dir_server_line(const char *line, authority_type_t required_type,
int validate_only)
@@ -4088,8 +4088,9 @@ parse_dir_server_line(const char *line, authority_type_t required_type,
* authority for. */
log_debug(LD_DIR, "Trusted %d dirserver at %s:%d (%s)", (int)type,
address, (int)dir_port, (char*)smartlist_get(items,0));
- add_trusted_dir_server(nickname, address, dir_port, or_port, digest,
- v3_digest, type);
+ if (!add_trusted_dir_server(nickname, address, dir_port, or_port,
+ digest, v3_digest, type))
+ goto err;
}
r = 0;