summaryrefslogtreecommitdiff
path: root/src/or/bridges.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-02-14 12:21:31 -0500
committerNick Mathewson <nickm@torproject.org>2017-02-28 08:16:33 -0500
commit1582adabbb13871bcf6f91be4fa8523aeb36f79a (patch)
tree7d31fb0d465bc9dbd4149dcc096e79dcb87f3897 /src/or/bridges.h
parentf5995692dadf9bc038455d7e701be84937f28d82 (diff)
downloadtor-1582adabbb13871bcf6f91be4fa8523aeb36f79a.tar.gz
tor-1582adabbb13871bcf6f91be4fa8523aeb36f79a.zip
Change approach to preventing duplicate guards.
Previously I'd made a bad assumption in the implementation of prop271 in 0.3.0.1-alpha: I'd assumed that there couldn't be two guards with the same identity. That's true for non-bridges, but in the bridge case, we allow two bridges to have the same ID if they have different addr:port combinations -- in order to have the same bridge ID running multiple PTs. Fortunately, this assumption wasn't deeply ingrained: we stop enforcing the "one guard per ID" rule in the bridge case, and instead enforce "one guard per <id,addr,port>". We also needed to tweak our implementation of get_bridge_info_for_guard, since it made the same incorrect assumption. Fixes bug 21027; bugfix on 0.3.0.1-alpha.
Diffstat (limited to 'src/or/bridges.h')
-rw-r--r--src/or/bridges.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/or/bridges.h b/src/or/bridges.h
index de23fe6eeb..27ea5e197c 100644
--- a/src/or/bridges.h
+++ b/src/or/bridges.h
@@ -27,6 +27,10 @@ bridge_info_t *get_configured_bridge_by_addr_port_digest(
const tor_addr_t *addr,
uint16_t port,
const char *digest);
+bridge_info_t *get_configured_bridge_by_exact_addr_port_digest(
+ const tor_addr_t *addr,
+ uint16_t port,
+ const char *digest);
int addr_is_a_configured_bridge(const tor_addr_t *addr, uint16_t port,
const char *digest);