]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix clear_trackhostexits_mapping() to actually work as advertised
authorNick Mathewson <nickm@torproject.org>
Wed, 27 Apr 2011 21:21:41 +0000 (17:21 -0400)
committerNick Mathewson <nickm@torproject.org>
Wed, 27 Apr 2011 21:23:05 +0000 (17:23 -0400)
Previously, it would remove every trackhostexits-derived mapping
*from* xyz.<exitname>.exit; it was supposed to remove every
trackhostexits-derived mapping *to* xyz.<exitname>.exit.

Bugfix on 0.2.0.20-rc: fixes an XXX020 added while staring at bug-1090
issues.

changes/clear_trackexithost [new file with mode: 0644]
src/or/connection_edge.c

diff --git a/changes/clear_trackexithost b/changes/clear_trackexithost
new file mode 100644 (file)
index 0000000..701d369
--- /dev/null
@@ -0,0 +1,5 @@
+  o Minor bugfixes:
+    - Fix a bug in the code where we could keep trying to use a
+      TrackHostExits-based mapping after we failed to reach the intended
+      destination node.  Bugfix on 0.2.0.20-rc.
+
index 082cd5f1d7e33e327ffdf5499e021676426c7cb5..2c1196c0cdb6b55415ffa7569aebc66adbbdcf8e 100644 (file)
@@ -799,8 +799,8 @@ clear_trackexithost_mappings(const char *exitname)
   tor_strlower(suffix);
 
   STRMAP_FOREACH_MODIFY(addressmap, address, addressmap_entry_t *, ent) {
-    /* XXXX022 HEY!  Shouldn't this look at ent->new_address? */
-    if (ent->source == ADDRMAPSRC_TRACKEXIT && !strcmpend(address, suffix)) {
+    if (ent->source == ADDRMAPSRC_TRACKEXIT &&
+        !strcmpend(ent->new_address, suffix)) {
       addressmap_ent_remove(address, ent);
       MAP_DEL_CURRENT(address);
     }