aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--changes/annotations_fix10
-rw-r--r--changes/bug20505
-rw-r--r--src/or/config.c3
-rw-r--r--src/or/routerparse.c17
4 files changed, 29 insertions, 6 deletions
diff --git a/changes/annotations_fix b/changes/annotations_fix
new file mode 100644
index 0000000000..b259a306d2
--- /dev/null
+++ b/changes/annotations_fix
@@ -0,0 +1,10 @@
+ o Major bugfixes
+ - Do even more to reject (and not just ignore) annotations on
+ router descriptors received anywhere but from the cache.
+ Previously we would ignore such annotations at first, but cache
+ them to disk anyway. Bugfix on 0.2.0.8-alpha. Found by piebeer.
+
+ o Minor bugfixes
+ - Enforce multiplicity rules when parsing annotations. Bugfix on
+ 0.2.0.8-alpha. Found by piebeer.
+
diff --git a/changes/bug2050 b/changes/bug2050
new file mode 100644
index 0000000000..3e45d3463f
--- /dev/null
+++ b/changes/bug2050
@@ -0,0 +1,5 @@
+ o Major bugfixes:
+ - Learn our external IP address when we're a relay or bridge, even if
+ we set PublishServerDescriptor to 0. Bugfix on 0.2.0.3-alpha,
+ where we introduced bridge relays that don't need to publish to
+ be useful. Fixes bug 2050.
diff --git a/src/or/config.c b/src/or/config.c
index ee0c466e0b..06a9a3b163 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -2406,8 +2406,7 @@ resolve_my_address(int warn_severity, or_options_t *options,
}
tor_inet_ntoa(&in,tmpbuf,sizeof(tmpbuf));
- if (is_internal_IP(ntohl(in.s_addr), 0) &&
- options->_PublishServerDescriptor) {
+ if (is_internal_IP(ntohl(in.s_addr), 0)) {
/* make sure we're ok with publishing an internal IP */
if (!options->DirServers && !options->AlternateDirAuthority) {
/* if they are using the default dirservers, disallow internal IPs
diff --git a/src/or/routerparse.c b/src/or/routerparse.c
index 96749e5a74..1ce105abab 100644
--- a/src/or/routerparse.c
+++ b/src/or/routerparse.c
@@ -1312,10 +1312,16 @@ router_parse_entry_from_string(const char *s, const char *end,
s = cp+1;
}
- if (allow_annotations && start_of_annotations != s) {
- if (tokenize_string(area,start_of_annotations,s,tokens,
- routerdesc_token_table,TS_NOCHECK)) {
- log_warn(LD_DIR, "Error tokenizing router descriptor (annotations).");
+ if (start_of_annotations != s) { /* We have annotations */
+ if (allow_annotations) {
+ if (tokenize_string(area,start_of_annotations,s,tokens,
+ routerdesc_token_table,TS_NOCHECK)) {
+ log_warn(LD_DIR, "Error tokenizing router descriptor (annotations).");
+ goto err;
+ }
+ } else {
+ log_warn(LD_DIR, "Found unexpected annotations on router descriptor not "
+ "loaded from disk. Dropping it.");
goto err;
}
}
@@ -3967,6 +3973,9 @@ tokenize_string(memarea_t *area,
end = start+strlen(start);
for (i = 0; i < _NIL; ++i)
counts[i] = 0;
+
+ SMARTLIST_FOREACH(out, const directory_token_t *, t, ++counts[t->tp]);
+
while (*s < end && (!tok || tok->tp != _EOF)) {
tok = get_next_token(area, s, end, table);
if (tok->tp == _ERR) {